将此 html 翻译成 haml
Translate this html to haml
我试图将此 html 翻译成 haml。我使用 http://html2haml.herokuapp.com/ and http://htmltohaml.com/ 没有成功。
<li class="nav-item btn-group" data-behavior="notifications" data-notifications='<%= render template: "notifications/index", formats: [:json] %>'>
</li>
他们给了我这两个:
%li.nav-item.btn-group{"data-behavior" => "notifications", "data-notifications" => render template: "notifications/index", formats: [:json]}
但是我有一个 SyntaxError 运行 这个。
有人可以帮我吗?
我希望这个有用,
%li.nav-item.btn-group{"data-behavior" => "notifications", "data-notifications" => (render partial: "notifications/index")}
%li.nav-item.btn-group{ :data => { :behavior => "notifications", :notifications => (render template: "notifications/index", formats: [:json]) }}
我试图将此 html 翻译成 haml。我使用 http://html2haml.herokuapp.com/ and http://htmltohaml.com/ 没有成功。
<li class="nav-item btn-group" data-behavior="notifications" data-notifications='<%= render template: "notifications/index", formats: [:json] %>'>
</li>
他们给了我这两个:
%li.nav-item.btn-group{"data-behavior" => "notifications", "data-notifications" => render template: "notifications/index", formats: [:json]}
但是我有一个 SyntaxError 运行 这个。 有人可以帮我吗?
我希望这个有用,
%li.nav-item.btn-group{"data-behavior" => "notifications", "data-notifications" => (render partial: "notifications/index")}
%li.nav-item.btn-group{ :data => { :behavior => "notifications", :notifications => (render template: "notifications/index", formats: [:json]) }}