2012-02-29 51 views
0

在代码的一部分下面我仍然得到这个错误:HAML - 语法错误,意想不到的keyword_ensure

syntax error, unexpected keyword_ensure, expecting $end): 
17:  %input.btn.btn-primary{:name => "commit", :type => "submit", :value => "Set As Profile Picture"}/ 

代码:

#settings_photos_window.wide_width.modal.fade 
    = form_tag '/photos/set_avatar', :method => 'post' do 
    .modal-header 
     %a.close{"data-dismiss" => "modal"} × 
     %h3 Choose Your Profile Picture 
    #choose_profile_pic.modal-body 
     = hidden_field_tag 'photo[avatar]', ((@cur_avatar) ? @cur_avatar.id : '') 
     - @settings_photos.each_slice(2) do |slice| 
     .row{:style => "text-align: left;"} 
     - slice.each do |photo| 
      - (photo.avatar == 1) ? (bg_color = 'background: #28AD4B;') : (bg_color = 'background: #fff;') 
      .span5.choose_picture{:style => "cursor: pointer; margin-right: 40px;"} 
       %div 
       = image_tag(photo.photo.url(:thumb), :class => 'thumbnail', :id => photo.id, :style => bg_color) 
       %br/ 
    .modal-footer 
     %input.btn.btn-primary{:name => "commit", :type => "submit", :value => "Set As Profile Picture"}/ 

出了什么问题,或者没有按......”是否存在HAML的任何调试器? 感谢

回答

1

我觉得周围的tenary报表的大概括号。它只是一个猜测,但其余的似乎完全可以接受。

+0

是啊,你说得对,三元运营商线下必须移动2位向左 – user984621 2012-02-29 17:44:02

相关问题