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 user to add their comment to the page (<%= render :partial => "comments/new"%>).
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?
controllers/comments_controller.rb ... def create @comment = Comment.new(params[:comment]) if @comment.save redirect_to :controller => "posts", :action => "show", :id => @comment.post else #we're over in the comments controller - how do we get our data validation #errors from the comments model back over to the show page of posts? render :controller => "posts", :action => "show" #??? end