# Javascript\_include\_tag helper No route

**URL:** <https://www.ruby-forum.com/t/javascript-include-tag-helper-no-route/174230>\
**Category:** Rails\
**Created:** [August 22, 2009, 11:29pm UTC](https://www.ruby-forum.com/t/javascript-include-tag-helper-no-route/174230 "2009-08-22T23:29:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kadoudal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f0a364/32.png) [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Post date:** [August 22, 2009, 11:29pm UTC](https://www.ruby-forum.com/t/javascript-include-tag-helper-no-route/174230/1 "2009-08-22T23:29:08Z")

</div>

in the header of my layout I use the following helper

\<%= javascript\_include\_tag ‘accordion.js’, ‘application.js’ %\>

but I get an error when running

Processing ApplicationController#index (for 127.0.0.1 at 2009-08-22  
23:18:47) [GET]  
Parameters: {“1249998180”=\>nil}  
ActionController::RoutingError (No route matches “/javascripts/  
accordion.js” with {:method=\>:get}):

my javascript file is in public/javascripts/accordion.js

seems that the helper is not generating tehe correct path w /public/  
javascripts/accordion.js

is it right ?

thanks fyi

---

<div class="post-metadata">

**Author:** ![kadoudal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f0a364/32.png) [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Post date:** [August 22, 2009, 11:56pm UTC](https://www.ruby-forum.com/t/javascript-include-tag-helper-no-route/174230/2 "2009-08-22T23:56:04Z")

</div>

Where in the source is your javascript\_include\_tag and how does the  
actual source look?

---

<div class="post-metadata">

**Author:** ![kadoudal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f0a364/32.png) [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Post date:** [August 23, 2009, 9:11am UTC](https://www.ruby-forum.com/t/javascript-include-tag-helper-no-route/174230/3 "2009-08-23T09:11:00Z")

</div>

here is my layout.html.erb

Home \<%= javascript\_include\_tag 'accordion.js', 'application.js' %\> ... ...

generated   
… I use a sub-uri :  
config.action\_controller.relative\_url\_root = “/academy”  
the generated code should be : ???

---

<div class="post-metadata">

**Author:** ![kadoudal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f0a364/32.png) [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Post date:** [August 23, 2009, 9:30am UTC](https://www.ruby-forum.com/t/javascript-include-tag-helper-no-route/174230/4 "2009-08-23T09:30:19Z")

</div>

I think it’s an environment description issue  
when being in development mode, w mongrel , I should not mention the  
sub-uri, so it goes directly to htp://localhost:3000/  
if I test with Apache mod-rails I should mention the sub-uri AND the  
asset host

I’ll test it

thanks
