我有一个多行的块,例如:
%li
=link_to image_tag("image.jpg", :size => "48x48", :alt => "Something", :title => "Something", :class => "some-class"), some_path
%p.testi
"Some text right here that is divided up onto multiple lines &
%br
and just won't stop running on!”
我需要一个环绕图像和文本的链接。目前图像链接工作正常,但是在文本链接上,我相信我必须从一个link_to块开始,但我没有看到我应该遵循的语法。
这是如何正确完成的,以便所有多行文本都应用了链接?
答案 0 :(得分:7)
苗条(应该相似):
= link_to some_path, class: "some-class" do
h2 = "#{some_object.title}"
p.testi
"Some text right here that is divided up onto multiple lines &
br/
and just won't stop running on!”
答案 1 :(得分:0)
你想使用|在你包装的每一行的末尾。