OK, this has me stumped…I have a Posts controller and model and a
Comments controller and model. Posts has a show method and a
corresponding view that shows a post and its associated comments, which
are rendered with a partial
from comments (<%= render :partial => “comments/comment”, :collection =>
@post.comments %>). Another partial from comments is used to allow the
to add their comment to the page (<%= render :partial =>
Problem: If a user tries to add a new comment but it fails the comment
model validation, how do I get back to the show page from posts and
display the model validation error for the new comment?
@comment = Comment.new(params[:comment])
redirect_to :controller => “posts”, :action => “show”, :id =>
#we’re over in the comments controller - how do we get our data
#errors from the comments model back over to the show page of posts?
render :controller => “posts”, :action => “show” #???