3

I have a multiline chunk such as this:

%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!”

I need a link to surround both the image and the text. Presently the image link works fine, however on the text link, I believe I have to start with a link_to block, but I'm not seeing the syntax that I should follow there.

How is this correctly done so that all of the multiple lines of text also have a link applied?

ylluminate
  • 12,102
  • 17
  • 78
  • 152

2 Answers2

7

In slim (wich should be similar):

= 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!”
Simon Bagreev
  • 2,879
  • 1
  • 23
  • 24
0

See Multiline string in HAML

You want to use the | at the end of each line you are wrapping.

Community
  • 1
  • 1
Jimmy Bosse
  • 1,344
  • 1
  • 12
  • 24