我尝试使用以下代码在Facebook上进行分享:
<%= link_to 'Share on Facebook', 'https://www.facebook.com/dialog/share?
app_id=xxxxxxxxxxxxxx&href=#{request.original_url}&redirect_uri=#{request.original_url}' %>
毋庸置疑,href和uri链接不会被提供。如何将导轨术语request.original_url
插入此链接?
有可能吗?
答案 0 :(得分:2)
将您的代码更改为:
<%= link_to 'Share on Facebook', "https://www.facebook.com/dialog/share?
app_id=xxxxxxxxxxxxxx&href=#{request.original_url}&redirect_uri=#{request.original_url}" %>