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
This error occurs when you have not add jquery_ujs file. You just included the jquery file.
So you need to add both files manually in you view or require them in application.js or any other file which you are using for specific layout.
Depending upon your scenario, you can follow 1st or 2nd solution.
1st solution:
<%= javascript_include_tag :jquery, :jquery_ujs %>
2nd solution:
Require both jquery and jquery_ujs in app/assets/application.js
//= require jquery.js
//= require jquery_ujs
Include application.js file in your specific layout file.
<%= javascript_include_tag :application %>
Note:
Also add csrf tag in layout file for both solutions.
<%= csrf_meta_tag %>
I'm asuming that you have below code in your Gemfile and already installed this Gem.
gem 'jquery-rails'