generate an real url with rails for an e-mail

隐身守侯 提交于 2019-12-11 14:01:37

问题


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 )%> 

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

mycontroller/show/id

we need an link like this structure

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

Can everyone help us please?


回答1:


you can pass :only_path => false

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


来源:https://stackoverflow.com/questions/10437811/generate-an-real-url-with-rails-for-an-e-mail

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!