Confusing rails div id naming

Posted by RailAddict on Stack Overflow See other posts from Stack Overflow or by RailAddict
Published on 2010-03-14T14:12:47Z Indexed on 2010/03/14 14:15 UTC
Read the original article Hit count: 344

Filed under:
|

I have started using jQuery and rails. I have made a simple form that submits to the database and updates the page without reloading with ajax.

In my jQuery functions I used $"#new_comment" for the id name (in my application.js and create.js.erb files) but on my articles/show view file, I named the div "add_comment" and it works..

I renamed it new_comment and it breaks! Can someone explain it please? I get an error: "no action responded to 1"

My function in my controller is "create".

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about jQuery