-1

How can I insert a link_to alongside text in a <p> tag using Slim?

here is my html.slim view :

p.subtitle = t('.subtitle')
 = link_to 'Link', t('.title_link')

But it doesn't work

I also tried :

p.subtitle = t('.subtitle')
= link_to 'Link', t('.title_link')

This works but the link is outside the <p> tag

Stefan
  • 109,145
  • 14
  • 143
  • 218
TheGame
  • 91
  • 1
  • 8

1 Answers1

1

By using p.subtitle = t('.subtitle') you close p tag immediately. This code should work for you:

p.subtitle 
  = t('.subtitle')
  = link_to 'Link', t('.title_link')
Yakov
  • 3,033
  • 1
  • 11
  • 22