My rails 4 app isn't processing jQuery .click events at all.
From the Chrome browser console it works when I type this then click a h3.
$("h3").click(function() { return alert("Clicked that thang");}); // This alerts on click of a h3
But when I include the equivilent code (in CoffeeScript) in my app it does nothing..
# app/assets/javascripts/collaborators.js.coffee
alert("does this work?") // yes this pops up an alert
$("h3").click ->
alert("Does this work?") // sadly nothing now happens when I click my h3's
I can tell that jQuery is loaded.
Chrome console:
>> $.fn.jquery
"1.10.2"
I also had a go at clearing the asset pipeline:
$> rake asset clean # but that didn't help me either.
Help, what's up, what am I missing?
Rails 4.0 app.