Haml错误:语法错误,意外的keyword_ensure,期待输入结束......:Util.html_safe(_erbout);确保; @haml_buffer = @haml_buffer .... ... ^

时间:2015-10-15 09:47:42

标签: html ruby-on-rails ruby haml

我收到这样的错误: enter image description here

实际上我也使用2个空格haml语法。使用haml标签可以使用ruby代码。如何解决它们?

这是代码:

    %li
      = image_tag('leaf.jpg')
        .caption
          .slide-text-info.bounceInDown{"data-wow-delay" => "0.4s"}
            %h1 welcome to our marketplace
            %p Lorem ipsum dolor sit amet, consectetur adipisicing elit.Sed nisi metus,tristique ndolor non,ornare sagittis dolor.Nulla vestibulu lacus...
            .slide-btns
              %a.startnow{:href => "#"} VIWE MORE
              %a.livedemo{:href => "#"} VIDEO TOUR

1 个答案:

答案 0 :(得分:2)

尝试将内容放入块中:

%li
  = image_tag('leaf.jpg') do
    .caption
      .slide-text-info.bounceInDown{"data-wow-delay" => "0.4s"}
        %h1 welcome to our marketplace
        %p Lorem ipsum dolor sit amet, consectetur adipisicing elit.Sed nisi metus,tristique ndolor non,ornare sagittis dolor.Nulla vestibulu lacus...
        .slide-btns

          %a.startnow{:href => "#"} VIWE MORE
          %a.livedemo{:href => "#"} VIDEO TOUR

(请注意do之后的image_tag