如何将link_to中的text和ruby代码放在haml的同一行?

Tim*_* T. 1 ruby haml ruby-on-rails

我试图把一link_to(,并)通过这样做:

= div_for review do
    = link_to review.title, review_path(review)
    (
    = link_to review.user.email, user_path(review.user)
    )
Run Code Online (Sandbox Code Playgroud)

结果不是我想要的,因为它在括号和链接文本之间放置了空格,所以它看起来像:

 link1 ( link2 )
Run Code Online (Sandbox Code Playgroud)

但我希望它看起来像:

 link1 (link2)
Run Code Online (Sandbox Code Playgroud)

我如何使用haml做到这一点?

小智 5

我最近对haml感兴趣

== - Ruby插值字符串

%h1== (#{link-to review.user.email, user_path(review.user)})
Run Code Online (Sandbox Code Playgroud)

就好像

%h1= raw "(#{link_to review.user.email, user_path(review.user)})"
Run Code Online (Sandbox Code Playgroud)