Wondering if this is possible in an elegant global way to adjust RoR's
urls...
Basically what I would like to do is make Rails aware that it needs to
have to adjust all the urls that refer to itself by a preceeding "/
rails" in the urls. I've tried things in routes.rb such as "map.test
'rails/:controller, :action'", etc.., but to no avail. Currently the
only way I've been able to do this is to more or less hard code it
( which may not be too bad of a thing in this case ) in any .rhtml
files with a link_to adjustment, as in
<%= link_to "newBYE", :controller => "/rails/hello", :action =>
"list_times" %>
Not knowing RoR well enough yet to know if this is going to be a
problem.. but it seems to me a routes.rb generating solution would be
better. I wouldn't think this would be that hard, but perhaps it's
to much away from "convention over configuration".
The reason I want to do this is because at first we'll be using Apache
to proxy Rails requests, and the '/rails' is the flag for Apache to
hit on the reverse proxy.
Wondering if this is possible in an elegant global way to adjust RoR's
urls...
Basically what I would like to do is make Rails aware that it needs to
have to adjust all the urls that refer to itself by a preceeding "/
rails" in the urls. I've tried things in routes.rb such as "map.test
'rails/:controller, :action'", etc.., but to no avail. Currently the
only way I've been able to do this is to more or less hard code it
( which may not be too bad of a thing in this case ) in any .rhtml
files with a link_to adjustment, as in
<%= link_to "newBYE", :controller => "/rails/hello", :action =>
"list_times" %>
Not knowing RoR well enough yet to know if this is going to be a
problem.. but it seems to me a routes.rb generating solution would be
better. I wouldn't think this would be that hard, but perhaps it's
to much away from "convention over configuration".
The reason I want to do this is because at first we'll be using Apache
to proxy Rails requests, and the '/rails' is the flag for Apache to
hit on the reverse proxy.
Thanks for any information,
-Dave
Since you'll be using Apache you can have it do the work for you by doing something like: