I’m currently using Ruby on Rails 3.2.8 and have this redirect in config/routes.rb:
root :to => redirect("/home/index.html")
which works fine for redirecting http://localhost:3000/ to http://localhost:3000/home/index.html in development. But in my test environment, I’m using a proxy and a subpath, setting relative_url_root in config/environments/test.rb like this:
config.action_controller.relative_url_root = '/testpath'
So I would expect a redirect from http://testdomain.com/testpath to http://testdomain.com/testpath/home/index.html but instead it redirects to http://testdomain.com/home/index.html.
How can I change my redirect statement to use relative_url_root in case it is set?
I don’t think that the method is deprecated, but it does seem to be broken. You should be able to work around the issue with something like this:
It might be worth pointing out that this bug is not reproducible on my machine (I am using thin), the code you posed works as intended.