HTML<;a>;标记为Ruby?
我认为有一个相对简单的答案,但我如何才能将此链接链接到:HTML<;a>;标记为Ruby?,html,ruby-on-rails,ruby,Html,Ruby On Rails,Ruby,我认为有一个相对简单的答案,但我如何才能将此链接链接到: <%= link_to(image_tag(p.thumbnail, class: "hoi"), "Something in here?") %> …与此相同的链接: <a class="fg" href="#<%= p.id %>" data-toggle="modal"> ? (为了清楚起见:当我单击链接到的中的图像时,我想使用数据切换=“modal”选项链接到href=“#”。尝试以
<%= link_to(image_tag(p.thumbnail, class: "hoi"), "Something in here?") %>
…与此相同的链接:
<a class="fg" href="#<%= p.id %>" data-toggle="modal">
?
(为了清楚起见:当我单击链接到的
中的图像时,我想使用数据切换=“modal”
选项链接到href=“#”
。尝试以下操作:
<%= link_to "##{p.id}", "Something in here?", :class => "fg", :data-toggle => "modal" %>
“fg”,:数据切换=>“模式”%>
如果您试图将图像链接到页面上的定位点,请执行以下操作:
<%= link_to(image_tag(p.thumbnail, class: "hoi"), "##{p.id}") %>
你可以在erb块内进行普通的ruby字符串插值(
)你想把#“
作为href元素的值吗?呵呵,我现在看到了(我试着把这个#
放在
块内,这就是我没有做的原因)。谢谢!我最终得到了这个:
“modal”)>`