2011-12-13 7 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!” 
関連する問題