How to include full-path in Rails 3 link_to statement?

后端 未结 6 558
说谎
说谎 2021-01-17 10:17

I am trying to put a Rails link_to statement inside a Mailer email that includes the full-path (ie - http://localhost/contacts/id/confirm). The link_to statement that I am

6条回答
  •  广开言路
    2021-01-17 10:56

    First step:

    #config/environments/production.rb
    config.action_mailer.default_url_options = { :host => 'www.example.com' }
    
    #config/environments/development.rb
    config.action_mailer.default_url_options = { :host => 'localhost:3000' }
    

    Second step:

    <%= link_to "here", confirm_contacts_url(17) %>
    

提交回复
热议问题