I assumed that it is 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 are my dummy rails application , but there is no jQuery in the source, and the delete link does not work ... any ideas that are missing
Check out this Railscast . You can check the file application.jsand make sure that it contains the following statement.
application.js
//= require jquery //= require jquery_ujs
-urj Gemfile, jquery.js query_ujs.js:
rails generate jquery:install
jquery.js .
"commented out" application.js, :
. , jquery jquery_urj. , js application.js.
, jquery /, /.
app/assets , .
lib/assets - , .
/ , , jquery.
JQuery rails 3.1. jquery-rails.
application.js .
http://blog.nodeta.com/2011/06/14/rails-3-1-asset-pipeline-in-the-real-world/
Just download a copy of jQuery from here: http://code.jquery.com/jquery-1.6.2.js
Then copy the jquery-1.6.2.js file to your <> / public / javascripts folder .
Then, in your application.html.erb file in your layout, include the jquery file before including the application.js file, as shown below:
<%= javascript_include_tag 'jquery-1.6.2', 'application' %>
Then you are good to go.