Rails 3 relative root url is not used in links
I have a rails 3.0.1 app hosted on www.example.com/v1
using Phusion Passenger. In my configuration, I have the following:
ENV['RAILS_RELATIVE_URL_ROOT'] = "/v1"
Rail apps load fine. The problem is with links on the page. Whenever I use link_to
with "/ some_path" as the url, the final url www.example.com/some_path
should be www.example.com/v1/some_path
.
Why link_to
doesn't it recognize my relative url root and include it when building links? How do I get around this?
Thank.
+3
source to share
2 answers