Skip to content

Commit

Permalink
update readme with nested redirect example
Browse files Browse the repository at this point in the history
Signed-off-by: James Golick <james@giraffesoft.ca>
  • Loading branch information
Matthew Ford authored and jamesgolick committed Mar 10, 2009
1 parent d995c62 commit ce9143f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.rdoc
Expand Up @@ -72,6 +72,16 @@ Or you can create a whole new block. This syntax destroys everything that's the
wants.js { render :template => "show.rjs" } wants.js { render :template => "show.rjs" }
end end
end end

If you have a nested resource and want to redirect to the parent after create/update and destroy you can do this in the object controller

class CommentsController < ResourceController::Base
belongs_to :post

create.wants.html { redirect_to smart_url(parent_url_options) }
update.wants.html { redirect_to smart_url(parent_url_options) }
destroy.wants.html { redirect_to smart_url(parent_url_options) }
end


=== Scoping === Scoping


Expand Down

0 comments on commit ce9143f

Please sign in to comment.