I have no idea why this is not working, I\'m learning rails and I\'m following a book it says to do it like this:
<%= form_for([@article,@article.comm
Most likely what happens is that you are missing the rails.js file, which handles that for you, whether you are using prototype or jquery.
If you are using jQuery, the easiest way to get all the needed files is using the jquery-rails gem. This will add a generator to install jquery and the needed rails.js.
type something like inside your rails application root:
rails g jquery:install
And then, inside your application.html.erb add the line
<%= javascript_include_tag :defaults %>
or explicitly (do not forget to include your jquery separately):
<%= javascript_include_tag :rails, :application %>
[EDIT: for Rails 3.1 or greater using the asset pipeline]
Use the jquery-rails gem (as mentioned above) and add the following lines to the app/assets/javascripts/application.js (if they are not there already) :
//= require jquery
//= require jquery_ujs
Hope this helps!