Rails - using `url_for` with route path in email does not include host -
Rails - using `url_for` with route path in email does not include host -
while not documented nor shown in examples, url_for
can used paths (e.g., url_for(signup_path)
produce /signup
) vs controllers , actions.
however, in doing not include host if 1 set in corresponding environment file.
reference: http://api.rubyonrails.org/classes/actiondispatch/routing/urlfor.html
why behavior?
if want total url, use:
url_for(signup_url)
from rails guide on route helpers:
each of these [_path
] helpers has corresponding _url
helper (such photos_url
) returns same path prefixed current host, port , path prefix.
ruby-on-rails ruby-on-rails-4
Comments
Post a Comment