Forum: Ruby on Rails Returning from Ajax call - "redirect_to error"

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
rh (Guest)
on 2006-03-17 06:50
I have Ajax commenting on my site, well, I'm trying to get it working.
It worked fine locally, but when I posted to the server, I'm getting an
"Application Error (Rails)", and I checked the logs, and it has:

(stack trace too deep)

With the second line continuing forever.  Here's my controller:

def comments
    content = Content.find(params[:id])
    @comment =[:comment])
    content.comments << @comment
    @comment_count = Comment.count("content_id=#{params[:id]}")

#remote form
<%= form_remote_tag(
          :url => {:controller => 'inventory', :action => 'comments',
:id =>},
          :update => {:success => "new-comment"},
          :loading => "'loading');",
          :success => "Element.hide('loading');",
          :complete => "clearText();",
          :position => "bottom"
          ) %>

     <%= text_field "comment", "name", :size => "20" %></p>

     <%= text_field "comment", "site", :size => "20" %></p>

     <%= text_area "comment", "entry", :rows => "7", :cols => "35"%></p>

     <p><input type="submit" name="submit" id="form-submit-button"
value="Post Remark" class="btn" /><img id="loading"
src="../../../../../images/loading.gif" alt="" style="display: none;"

     <div class="cmnt-rss"><a href="/new/commentsfeed/" title="Syndicate
Comments (RSS 2.0)"><img src="../../../../../images/rss_g.png" alt="RSS
2.0" /></a></div>

    <%= end_form_tag %>

Can someone please help with this?  Why is 'url_for' used?  What does it
do, and should I be using it?

Please help!  This is running live, and I can't fix it!

Thanks for any advice.
This topic is locked and can not be replied to.