嗨,所以我正在做一个项目,我想在闪存中有一个以模式打开的链接,所以我需要这个链接是远程的。所以我有
flash[:link] = { text: "Click here",
location: new_post_path,
remote: true
}但是当闪存被加载时,它实际上不是作为远程链接加载的吗?
任何帮助修复这将是非常感谢的。
发布于 2016-11-01 10:18:41
试试这个:
flash[:link] = "#{view_context.link_to('Click here',new_post_path, remote: true)}".html_safe您应按以下方式呈现闪存消息:
<% flash.each do |_, value| %>
<%= content_tag :div, value %>
<% end %>https://stackoverflow.com/questions/40357866
复制相似问题