This project is archived and is in readonly mode.
url_for does not automatically :only_path => false when :host is set
-
Evan Light
Specifically, docs for url_for claim :only_path defaults to false. However, setting :host without explicitly specifying :only_path => false results in a relative url.
That is:
url_for foo, :host => "bla.com"... provides a relative path but ...
url_for foo, :host => "bla.com", :only_path => false... provides an absolute path.
-
Evan Light
Er... replace "foo" with a controller and action. ;-)
-
Evan Light
More specifically, this only happens when using a named route helper. Using url_for directly works fine.
-
Evan Light
Please close this. Not a bug. Perhaps the documentation could use an update to remind people that url defaults to :only_path => false and path defaults to :only_path => true.
-
Andrew White
- State changed from new to invalid
- Importance changed from to Low