ruby on rails - want to edit resource of confirmation mail -


i'm using devise 3.3.0 , applied confirmable function user.

it work fine, when new user sign send confirmation email email id. send mail -

<p>welcome <%= @email %>!</p>  <p>you can confirm account email through link below:</p>  <p><%= link_to 'confirm account', confirmation_url(@resource, confirmation_token: @token) %></p> 

when check on terminal, send link -

<p><a href="http://localhost:3000/users/confirmation?confirmation_token=d1eyxrst5rk3q5fjyxsg">confirm account</a></p> 

but url of application 'demo.localhost.com:3000'

and confimable send link localhost:3000, want edit resource link demo.localhost.com:3000.

i think should edit @resource define , how edit it? or there better way pass url in confirmation mail?

you can achieve through setting default url options action mailer in config/environments/development.rb(if app in development) below

config.action_mailer.default_url_options = { host: 'demo.localhost', port: 3000 } 

now generated url like

<p><a href="http://demo.localhost:3000/users/confirmation?confirmation_token=d1eyxrst5rk3q5fjyxsg">confirm account</a></p> 

Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -