I assumed it was already installed but in my gemfile i have
gem "jquery-rails"
but in the asset/javascripts folder i have
accounts.js.coffee
application.js
which are both commented out
Here is my dummy rails application but in the source there is no jQuery and the delete link doesnt work...any ideas whats missing
Have a look at this Railscast. You might want to check the application.js
file and make sure it contains the following statement.
//= require jquery
//= require jquery_ujs
Besides adding query-urj in you Gemfile, you also need to run this to generate jquery.js and query_ujs.js:
rails generate jquery:install
This will install jquery.js for you.
As for the 'commented out' application.js, if it has these lines:
//= require jquery
//= require jquery_ujs
Then you're ready to go. They are not just comments, they actually tell the pipeline to use jquery and jquery_urj. When you app runs, both js files will be merged into application.js.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With