Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

releasing 0.0.7 which is the last release before a 1.0.

  • Loading branch information...
commit 818b98d0426060a64e1e26f96c26d24c765a96ec 1 parent ac95081
@apotonick authored
Showing with 19 additions and 3 deletions.
  1. +4 −0 CHANGES.markdown
  2. +14 −2 README.markdown
  3. +1 −1  lib/roar/rails/version.rb
View
4 CHANGES.markdown
@@ -1,3 +1,7 @@
+h2. 0.0.7
+
+* Introduce `:represent_with` and `:represent_items_with` for `#respond_with`. In turn, deprecate the old behaviour since it will change in 1.0.
+
h2. 0.0.6
* Make roar-rails rely on roar 0.10 and bigger.
View
16 README.markdown
@@ -26,7 +26,7 @@ class SingersController < ApplicationController
end
```
-Need to use a representer with a different name than your model? Pass it in using the `:with_representer` option:
+Need to use a representer with a different name than your model? Pass it in using the `:represent_with` option:
```ruby
class SingersController < ApplicationController
@@ -35,7 +35,19 @@ class SingersController < ApplicationController
def show
singer = Musician.find_by_id(params[:id])
- respond_with singer, :with_representer => SingerRepresenter
+ respond_with singer, :represent_with => SingerRepresenter
+ end
+end
+```
+
+If you don't want to write a dedicated representer for a collection of items (highly recommended, thou) but rather use a representer for each item, use the `+represent_items_with+` option.
+
+```ruby
+class SingersController < ApplicationController
+
+ def index
+ singers = Musician.find(:all)
+ respond_with singers, :represent_items_with => SingerRepresenter
end
end
```
View
2  lib/roar/rails/version.rb
@@ -1,5 +1,5 @@
module Roar
module Rails
- VERSION = "0.0.6"
+ VERSION = "0.0.7"
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.