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

后端 未结 6 555
说谎
说谎 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:53

    If the full url always matches the request of the user, you can alternatively use the actionmailer-with-request gem to have the request be forwarded to action mailer, then you can reference the request within your mail template, like:

    <%= link_to "log into the admin page", request.base_url + admin_root_path %> 
    

提交回复
热议问题