为电子邮件生成一个带有rails的真实URL [英] generate an real url with rails for an e-mail

查看:133
本文介绍了为电子邮件生成一个带有rails的真实URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们希望将自动生成的电子邮件发送到配置文件的完整路径。我们如何这样

We want to send an autogenerated E-Mail with an full path to the profile. How do we this

<%=link_to('Link', :controller => 'mycontroller', :action => 'show', :id => @mycontroller.id )%> 

link_to命令仅在邮件中构建这样的链接

The link_to command only builds the link in the mail like this

mycontroller/show/id

需要一个这样的结构

http://www.server.tld/mycontroller/show/id

可以帮助我们吗?

推荐答案

你可以通过:only_path => false

you can pass :only_path => false

<%= link_to('Link', :controller => 'mycontroller', :action => 'show', :id => @mycontroller.id, :only_path => false ) %> 

这篇关于为电子邮件生成一个带有rails的真实URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆