我有以下haml标记:
%a.logo-text{href: "/surveys"}
%b Survey
Builder
有没有办法重写这个来使用Ruby on Rails link_to
帮助器?
答案 0 :(得分:1)
= link_to '/surveys', class: 'logo-text' do
%b Survey
Builder
单行:
= link_to raw('<b>Survey</b>Builder'), '/surveys', class: 'logo-text'
答案 1 :(得分:1)
您可以将一个块传递给link_to helper:
= link_to "/surveys", class: "logo-text" do
%b Survey
Builder
或一行:
= link_to "<b>Survey</b>Builder".html_safe, "/surveys", class: "logo-text"