README.markdown in roar-rails-0.0.11 vs README.markdown in roar-rails-0.0.12
- old
+ new
@@ -98,11 +98,11 @@
respond_to :json
def create
singer = Singer.new
consume!(singer)
-
+
respond_with singer
end
end
```
@@ -118,9 +118,21 @@
Note that it respects settings from `#represents`. It uses the same mechanics known from `#respond_with` to choose a representer.
```ruby
consume!(singer, :represent_with => MusicianRepresenter)
+```
+
+## Using Decorators
+
+If you prefer roar's decorator approach over extend, just go for it. roar-rails will figure out automatically which represent strategy to use.
+
+```ruby
+class SingerRepresenter < Roar::Decorator
+ include Roar::Representer::JSON
+
+ property :name
+end
```
## URL Helpers
Any URL helpers from the Rails app are automatically available in representers.