我已经有一段时间了,因为我一直忙于Ruby on Rails和HAML,所以我正在尝试创建一个将字符串发布到/ query url的基本表单。但是我在日志中收到以下错误:
> Started GET "/" for 192.168.33.82 at
> Wed Apr 06 08:23:09 -0700 2011
> Processing by
> SearchEngineController#search as HTML
> Rendered search_engine/search.haml
> within layouts/application (4.1ms)
> Completed in 5ms
>
> ActionView::Template::Error (compile
> error
> /home/arne.de.herdt/RailsApps/roularta/app/views/search_engine/search.haml:21:
> syntax error, unexpected kENSURE,
> expecting $end):
> 18: = label_tag :query, 'Search for: '
> 19: = text_field_tag('Search...')
> 20: .links app/views/search_engine/search.haml:21:in
> `compile'
我的haml文件中的代码:
!!!
%head
= stylesheet_link_tag 'stylesheet'
%title Roularta Search Engine
%body
.content
.header
.body
%h1 Roularta SearchEngine demonstration
%p
Welcome to the Roularta Ferret Engine. To make a search for specific keywords, use the search
form below to create your query. To upload new XML files into the Ferret Index, click the link
below the search form.
%p
= "Currently operating in '#{ENV['RAILS_ENV']}' environment"
.searchform
- form_tag '/upload', :method => :post do
= label_tag :query, 'Search for: '
= text_field_tag('Search...')
.links
任何可以告诉我什么失踪的人?
答案 0 :(得分:0)
问题在于 - 在form_tag元素上。正如Peter Wong所说,它需要=