0

次のhamlの構文エラーが発生します

= javascript_include_tag :reports 
= stylesheet_link_tag    :form
= stylesheet_link_tag    :tab

.tabcontainer
  %ul.tabs
    %li#reports
      Reports
  .tab
    .field

= form_for @report, {:html => {class => "form"}} do |f|
  .field
    = f.label :Property
b
%form{ :action => "/reports/find/employees", :method => "get"}
  %fieldset
    %ol
      %li
        %label{:for => "property"} Property:
        %input{:type => "text", :name => "query[1][property]" }
      %li
        %label{:for => "comp"} Comparator:
        %input{:type => "text", :name => "query[1][comp]" }
      %li
        %label{:for => "value"} Value:
        %input{:type => "text", :name => "query[1][value]"}
    %input{:type => "submit", :value => "Go" }

取得するエラーは次のとおりです。

index.html.haml:12: syntax error, unexpected tASSOC
haml_temp =  form_for @report, {:html => {class => "form"}} do |f|
                                                  ^
index.html.haml:12: syntax error, unexpected '}', expecting keyword_end
haml_temp =  form_for @report, {:html => {class => "form"}} do |f|
                                                          ^
index.html.haml:17: syntax error, unexpected keyword_ensure, expecting $end
Extracted source (around line #12):

9:   .tab
10:     .field
11: 
12: = form_for @report, {:html => {class => "form"}} do |f|
13:   .field
14:     = f.label :Property
15: b

このエラーの原因は何ですか?

助けてくださいありがとう。

4

2 に答える 2

1

がありません。次の:ようにする必要があります。

haml_temp =  form_for @report, {:html => {:class => "form"}} do |f|
于 2012-08-14T12:13:33.957 に答える
0

form タグに がありますが、`class'html=> {some code}を見逃していました:

于 2012-08-21T11:13:11.750 に答える