mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-23 06:16:50 +00:00
Merge pull request #1805 from ScottKbka/fixingTyposInSerializerGuides
Fixing typo in Serializers guide for including a block after
This commit is contained in:
commit
b4615ea90f
@ -31,7 +31,7 @@ Serialization of the resource `title`
|
||||
|---------------------------- |-------------|
|
||||
| `attribute :title` | `{ title: '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' }`
|
||||
|
||||
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