I have a problem with jQuery on Rails 3.2.8. I installed gem jquery-rails and my application.js application has the following:
//= require jquery //= require jquery_ujs //= require_tree .
views / layouts / application.html.erb has
<%= javascript_include_tag "application" %>
A simple Javascript test in test.js:
if (jQuery) { alert('Jquery is loaded') } else { alert ('Jquery is not loaded') }
gives me a warning telling me that jQuery is really loaded.
However, no jQuery commands will work, even the main ones do not respond:
$(document).ready(function(){ $("a").click(function(event){ alert("Thanks for visiting!"); }); });
I tried everything - even re-enabling jQuery through the Google APIs. Any ideas on what might happen?
source share