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

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.
1e2dd87a31c5d3e07adc9efa375f4dc4?d=identicon&s=25 rh (Guest)
on 2006-03-17 05: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)
/usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/base.rb:447:in
`url_for'
    /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/base.rb:769:in
`redirect_to'
/usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/base.rb:769:in
`redirect_to'
/usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/base.rb:769:in
`redirect_to'
/usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/base.rb:769:in
`redirect_to'
...
...

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

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

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

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

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

     <p>Remark:<br/>
     <%= 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;"
/></p>

     <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.