Merge pull request #1805 from ScottKbka/fixingTyposInSerializerGuides

Fixing typo in Serializers guide for including a block after
This commit is contained in:
Yohan Robert 2016-06-15 13:00:52 +02:00 committed by GitHub
commit b4615ea90f

View File

@ -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.