Just started with Rails a couple weeks ago after a few years doing PHP.
I've got a blog going with URLS like
and each entry has a comment form and the end. This form calls an
action 'add_comment' in the 'blog' controller, with the URL
I was wondering whether it's possible for users to arrive back at the
first URL for the entry after trying to post a comment? Using
redirect_to with the entry's route means I can't use error_messages_for
on the comment in my entry's view. So instead, I'm just doing
@comment.save etc in blog#add_comment and then using
render :action show_entry
to show the entry the comment applies to. This retains the form values
and shows any errors produced. Can I have someone submit a comment and
be directed to
without losing the comment and its errors along the way?