jeudi 27 juillet 2017

Haml produces "{}" text on webpage

I am trying to convert from application.html.erb to application.haml and I get one small annoying problem being "{}" in top left corner.

problem

My code looks like this:

  %body
    = render 'shared/header'
    .container
      = flash.each do |message_type, message|
        .alert{class: "alert-#{message_type}"}= message
        -# = content_tag :div, message, class: "alert alert-#{message_type}"
      = yield
      = render 'shared/footer'

Commented out line is a second way to create div, but it produces same error.

HTML before conversion looked like this:

  <body>
    <%= render 'shared/header' %>
    <div class="container">
      <% flash.each do |message_type, message| %>
          <%= content_tag(:div, message, class: "alert alert-#{message_type}") %>
      <% end %>
      <%= yield %>
      <%= render 'shared/footer' %>
    </div>
  </body>

What's wrong with that? How do I fix it?




Aucun commentaire:

Enregistrer un commentaire