【问题标题】:Translate this html to haml将此html翻译成haml
【发布时间】:2016-01-13 08:57:25
【问题描述】:

我试图把这个 html 翻译成 haml。我使用http://html2haml.herokuapp.com/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 运行这个。 有人可以帮我吗?

【问题讨论】:

标签: html ruby-on-rails haml


【解决方案1】:
%li.nav-item.btn-group{ :data => { :behavior => "notifications", :notifications => (render template: "notifications/index", formats: [:json]) }}

【讨论】:

    【解决方案2】:

    我希望这个工作,

    %li.nav-item.btn-group{"data-behavior" => "notifications", "data-notifications" => (render partial: "notifications/index")}
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-11-14
      • 1970-01-01
      • 1970-01-01
      • 2020-12-01
      • 2017-07-24
      相关资源
      最近更新 更多