Skip to content
Browse files

update readme with nested redirect example

Signed-off-by: James Golick <james@giraffesoft.ca>
  • Loading branch information...
1 parent d995c62 commit ce9143f25fa11d9ee850b3b193e69f3dd732ed85 Matthew Ford committed with jamesgolick Mar 11, 2009
Showing with 10 additions and 0 deletions.
  1. +10 −0 README.rdoc
View
10 README.rdoc
@@ -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" }
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

0 comments on commit ce9143f

Please sign in to comment.
Something went wrong with that request. Please try again.