Hi. In my environment.rb, I have: ActionController::AbstractRequest.relative_url_root = "/foobar" In my layout, I have: <%= javascript_include_tag :defaults %> Question 1: I am getting an error: ActionController::RoutingError (no route found to match "/javascripts/prototype.js" with {:method=>:get}): When I remove the relative_url_root, everything works great. What gives? Question 2: What is the javascript file I want to use ajax, but no visual effects? Can I load just one? Thanks in advance. --rick -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Is anybody able to use javascript_include_tag with ActionController:AbstractRequest.relative_url_root?! Rick Foreman wrote:> Hi. In my environment.rb, I have: > > ActionController::AbstractRequest.relative_url_root = "/foobar" > > In my layout, I have: > > <%= javascript_include_tag :defaults %> > > > I am getting an error: > ActionController::RoutingError (no route found to match > "/javascripts/prototype.js" with {:method=>:get}): > > When I remove the relative_url_root, everything works great. What > gives? >-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I have the same problem, I''ve tried a zillion combinations of configuration, and I still can''t figure out any way to solve it. When I use the asset tag helpers with :all, :cache=>true and relative_url_root, asset loading behavior becomes completely erratic. Sometimes they load, sometimes they cache, and sometimes it''s a 404. The first time I run this in production mode, I get an error like the one you posted, saying the files could not be found. Rails is looking in a directory structure that repeats the relative_url_root AFTER the asset directory (some.host.com/foo/public/foo/javascripts/bar.js). A resulting concatenated all.js file is created which is empty. I''d be ok with moving my javascripts to the extra directory, but in development mode (without caching), they are invisible and I get the same same error in reverse. Furthermore in development mode, the timestamp is not appended to the javascript files. I can''t tell what''s breaking what... relative_url_root? javascript_include_tag? :cache=>true? Any help would be greatly appreciated... thanks Bill Other config stuff: OS X 10.4.10 Apache 1.3 Ruby 1.8.6 Rails 2.0.2 Mongrel 1.0.1 -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---