开发者

HAML Forms being weird

开发者 https://www.devze.com 2023-02-24 17:37 出处:网络
-form_tag(search_path, :method => :get) = label_tag(\"Place\") = text_field_tag(\"place\", nil, :id => \"place\")
-form_tag(search_path, :method => :get)
  = label_tag("Place")
  = text_field_tag("place", nil, :id => "place")
  = text_field_tag("near", nil, :id => "near")
  = submit_tag("Search", :id => "search", :name => "search", :class => "form_submit", :开发者_JAVA百科disabled => false, :disable_with => "Please wait...")

I have the code above and it returns the following error:

/app/app/views/venues/main.haml:7: syntax error, unexpected kENSURE, expecting $end

My application template is as follows:

%html
  %head
    %title
      WhosHere
    = stylesheet_link_tag :all
    = javascript_include_tag 'http://code.jquery.com/jquery-1.5.2.min.js'
    = csrf_meta_tag
  %body
    = yield


maybe you should have a "do" at the end of your form_tag, so that the system knows you want to pass a block to the form_tag?

- form_tag(search_path, :method => :get) do
  ...
0

精彩评论

暂无评论...
验证码 换一张
取 消