# Trouble loading rails generated javascript to view

**URL:** <https://www.ruby-forum.com/t/trouble-loading-rails-generated-javascript-to-view/126849>\
**Category:** Rails\
**Created:** [January 22, 2008, 7:26pm UTC](https://www.ruby-forum.com/t/trouble-loading-rails-generated-javascript-to-view/126849 "2008-01-22T19:26:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dracos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ea666f/32.png) [@dracos](https://www.ruby-forum.com/u/dracos)\
**Post date:** [January 22, 2008, 7:26pm UTC](https://www.ruby-forum.com/t/trouble-loading-rails-generated-javascript-to-view/126849/1 "2008-01-22T19:26:04Z")

</div>

I’ve been following Ryan’s recent railscast on creating dynamic select  
menus using javascript:

> **[\#88 Dynamic Select Menus - RailsCasts](http://railscasts.com/episodes/88-dynamic-select-menus)**
>
> Short Ruby on Rails screencasts containing tips, tricks and tutorials. Great for both novice and experienced web developers.

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:

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
