I originally had my view look something like:
<% @heading = “Bugs” %>
<%= link_to ‘Bug table’, :action => ‘bug_table’ %>
<% for bug in @bugs %> [etc., table]
But then I changed it to:
<% @heading = “Bugs” %>
<%= javascript_include_tag :defaults %> ← new line
<%= link_to ‘Bug table’, :action => ‘bug_table’ %>
and moved everything between into
public/javascripts/application.js.
Back when all the JS was in my view.rhtml, everything worked fine. Now
that it’s in application.js, none of the functions do anything – I
suspect that they’re not being loaded, somehow.
When I view source for the rendered page, I see
And, when I load up application.js?1191286272 and view its source, sure
enough, there’s my java-script, just as I’d expect.
So… what am I doing wrong?
Thanks!
P.S. Tried to Google + seach archives for this but, apparently, my
search-fu is weak – Google got me nothing, while this-forum returned
100s of hits, none of which seemed to address this issue (I searched on
+javascript +“not.loaded”) Hints there would be helpful, too