html
  • ruby-on-rails
  • haml
  • 2016-01-13 77 views 2 likes 
    2

    我試圖將此html轉換爲haml。我用http://html2haml.herokuapp.com/http://htmltohaml.com/沒有成功。將此html轉換爲haml

    <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錯誤。 有人可以幫我嗎?

    +1

    https://github.com/haml/html2haml –

    +0

    @AndreyDeineko感謝,但我只需要翻譯這行不是整個項目。 – jmcastel

    回答

    0
    %li.nav-item.btn-group{ :data => { :behavior => "notifications", :notifications => (render template: "notifications/index", formats: [:json]) }} 
    
    0

    我希望這一個工程,

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