Forum: Ruby on Rails HELP with redirect_to!

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
ry a. (Guest)
on 2006-03-04 20:05
I'm having trouble redirecting back to the same page after a comment is
posted.  To post a comment, this is what I'm doing:

#controller
def comments
    content = Content.find(params[:id])
    comment = Comment.new(params[:comment])
    content.comments << comment
    content.save
    redirect_to (
      :action => 'individual',
      :year => content.posted_at.year,
      :month => content.posted_at.month,
      :day => content.posted_at.day,
      :permalink => content.permalink   # line 61
    )
end

I'm getting a syntax error on line 61.  How can I redirect back to the
same page?

I've tried "redirect_to action => :back" and "redirect_to
request.request_uri" but neither one of them work.

Please help!
This topic is locked and can not be replied to.