mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-22 22:06:50 +00:00
Fixing typo in Serializers guide for including a block after
This commit is contained in:
parent
a52189c9c0
commit
43b6bae7fe
@ -31,7 +31,7 @@ Serialization of the resource `title`
|
|||||||
|---------------------------- |-------------|
|
|---------------------------- |-------------|
|
||||||
| `attribute :title` | `{ title: 'Some Title' } `
|
| `attribute :title` | `{ title: 'Some Title' } `
|
||||||
| `attribute :title, key: :name` | `{ name: 'Some Title' } `
|
| `attribute :title, key: :name` | `{ name: 'Some Title' } `
|
||||||
| `attribute :title { 'A Different Title'}` | `{ title: 'A Different Title' } `
|
| `attribute(:title) { 'A Different Title'}` | `{ title: 'A Different Title' } `
|
||||||
| `attribute :title`<br>`def title 'A Different Title' end` | `{ title: 'A Different Title' }`
|
| `attribute :title`<br>`def title 'A Different Title' end` | `{ title: 'A Different Title' }`
|
||||||
|
|
||||||
An `if` or `unless` option can make an attribute conditional. It takes a symbol of a method name on the serializer, or a lambda literal.
|
An `if` or `unless` option can make an attribute conditional. It takes a symbol of a method name on the serializer, or a lambda literal.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user