内联HAML链接,但内容

rct*_*eil 7 haml views ruby-on-rails

我试图输出一些东西

<p>Hello, this is my text. <a href="#">Link here</a> This is more text</p>
Run Code Online (Sandbox Code Playgroud)

但使用HAML

怎么做?我一直在寻找示例,但没有一个展示如何做到这一点,但链接的任何一侧都有纯文本?

尼尔

Chr*_*tto 26

如果你想做一个班轮:

%p= "Hello, this is my text. #{link_to 'Link here', '#'} This is more text".html_safe
Run Code Online (Sandbox Code Playgroud)

多行

%p 
  Hello, this is my text. 
  = link_to 'Link here', '#'
  This is more text
Run Code Online (Sandbox Code Playgroud)