Forum: Ruby on Rails Problems of "javascript_include_tag", cannot load the js fil

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
1292dfc5df2064e008f7f12b9c56561d?d=identicon&s=25 allen (Guest)
on 2007-04-12 12:59
(Received via mailing list)
Hi all,

I'm trying to use Ext JS with Rails and am wondering how should I
include it in my application. According to the convention of Rails,
javascript should be put in /public/javascripts and css should be put
in /public/stylesheets, then I'm supposed to use
"javascript_include_tag" and "stylesheet_link_tag" to load them to my

This shall be fine for the js and css files I created myself. But for
third-party lib like Ext JS, its internal mechanism highly depends on
the relative pathes of all its files (js, css, image, ect.). I think I
should keep its own hierarchy in some place and pass pass the full
path relative to my document root to "javascript_include_tag".

So I put them in /vendor/ext, which I thought is the place for third-
party lib and used "/vendor/ext/ext-all.js" to reference the js file I
want. But then I received an error in my FireBug said that "no route
found to match "/vendor/ext/ext-all.js" with
{:method=>:get}". I don't know why this problem occurs. Did I
select the wrong place? I also tried to put ext in /public and /app/
views, but neither of these worked.

How can I solve the problem? Thanks a lot.
83ca41657a99b65d99889abe712ba5e2?d=identicon&s=25 Jason Roelofs (Guest)
on 2007-04-12 14:53
(Received via mailing list)
The only files directly accessible to a web browser are those under the
public/ directory. Anything else is hidden away and won't work if you
try to
access it. If it needs to be accessible to the browser (js, css, static
html), it *must* be in public/.

This topic is locked and can not be replied to.