I've been following Ryan's recent railscast on creating dynamic select menus using javascript:
He suggests the following method to create and load rails generated javascript:
1. create a 'javascripts' controller 2. create a method within that controller 3. create a file called method_name.js.erb in app/views/javascripts 4. use an application helper method in the view to load the javascript in the head.
I've gotten javascripts/method_name.js to render properly in my browser. It appears to load into my view with this helper method:
<head> <script src="/javascripts/method_name.js" type="text/javascript"></script> </head>
The script doesn't seem to load however. The html source doesn't confirm much since I can get it to reference non-existent javascripts without error. Any idea what might be preventing the load or what I could check to get a better idea of what's going on?
Thanks,
Peter