Skip to content

Commit

Permalink
releasing 0.0.7 which is the last release before a 1.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
apotonick committed Jun 10, 2012
1 parent ac95081 commit 818b98d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
4 changes: 4 additions & 0 deletions 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.
Expand Down
16 changes: 14 additions & 2 deletions README.markdown
Expand Up @@ -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
Expand All @@ -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
```
Expand Down
2 changes: 1 addition & 1 deletion lib/roar/rails/version.rb
@@ -1,5 +1,5 @@
module Roar
module Rails
VERSION = "0.0.6"
VERSION = "0.0.7"
end
end

0 comments on commit 818b98d

Please sign in to comment.