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

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -