I''ve got two controllers, let''s call one Post and the other
Comment
for simplicity, i.e.:
class Post < ApplicationController
def show
...
end
end
class Comment < ApplicationController
def create
@comment ...
end
end
In my create() method I would like to redirect back to the show method
after I have saved the comment. But If I have errors in saving the
comment, how am I to display this with error_messages_for in my
template? I would still like to redirect in this case, and not just
display the template in create(). Is there someway to pass the error
messages for @comment back to show method? Or to pass the @comment
variable back to the show method? Calling render :action => show
from the create method also does not seem to solve this problem.
Any sugguestions?
Appreciating all the help. Thanks so much,
Scott Taylor