w7d3 - jBuilder Flashcards

1
Q

What jBuilder syntax will create an object?

A

A block.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What jBuilder method allows us to use multiple attributes of the same object?

A

json.extract!(obj, :attr1, :attr2, …)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What’s a shorthand for json.extract! ?

A

json.someKey obj, :attr1, :attr2

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What method lets you dynamically set the value of a key?

A

json.set!(theKeyValue) { … }

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What jBuilder method will change snake_case things into camelCase things?

A

json.key_format! camelize: :lower

How well did you know this?
1
Not at all
2
3
4
5
Perfectly