Paul
2011-Nov-04 17:47 UTC
Why is relative_root_url not used to automatically scope routes?
Rails has had the concept of the relative_root_url /
RAILS_RELATIVE_ROOT_URL for some time. In Rails 3.x (perhaps earlier
as well, but I can''t remember), the relative_root_url is only used to
generate asset paths.
I never understood why this relative_root_url isn''t also used to
automatically scope all the routes? Instead I have to do it manually,
CotaApp::Application.routes.draw do
MyApp
scope ActionController::Base.config.relative_url_root do
...
end
end
Sure, you can also use rewrite rules to strip the prefix before Rails
sees a url, but then how is Rails suppose to generate correct urls?
--
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.
