w7d3 - jBuilder Flashcards
1
Q
What jBuilder syntax will create an object?
A
A block.
2
Q
What jBuilder method allows us to use multiple attributes of the same object?
A
json.extract!(obj, :attr1, :attr2, …)
3
Q
What’s a shorthand for json.extract! ?
A
json.someKey obj, :attr1, :attr2
4
Q
What method lets you dynamically set the value of a key?
A
json.set!(theKeyValue) { … }
5
Q
What jBuilder method will change snake_case things into camelCase things?
A
json.key_format! camelize: :lower