Validation helpers and belongs_to/has_many problem


I’m adding comments to my blog, which is running on Rails code
that I wrote myself. So, I have Story and Comment:

class Story < ActiveRecord::Base
has_many :comments

class Comment < ActiveRecord::Base
belongs_to :story, :counter_cache => true
validates_length_of :author,
:maximum => 25,
:message => “Should be shorter”

That looks okay to me so far. Now, here’s the problem I’m having
and I need some help to solve it. I’ve added a form to the action that
displays the story plus all comments associated with it. That form
posts to an action in the controller:

def add_comment
@article = Story.find(@params[:story_id])

rescue ActiveRecord::RecordInvalid
  # We have an invalid record, so let's make sure the user knows 

# not sure what goes here to force the errors to show up in
another action
# so this is where I would put some sort of redirect

# Everything went well, so let's go back to the article
redirect_to :action => 'article', :id => @params[:story_id]


So basically, I want to trap the exception generated by
‘validates_length_of :author’ and pass that error when I redirect back
to my ‘article’ action. The idea is to send them back to the form, with
their posting intact and report the error message.

So, what’s the best way to handle this? Do I need to create a seperate
RHTML page just for the add_comment action or can I bend Rails to my
will here?