2011-12-13 47 views
1

我有一個多塊像這樣:如何將鏈接應用於HAML中的多行文本字符串?

%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塊開始,但是我沒有看到我應該遵循的語法。

這是如何正確完成,以便所有的多行文本也應用鏈接?

回答

6

在超薄(至極應該是相似的):

= 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!」 
相關問題