开发者

Compile error with haml

it's been a while since I've been busy with Ruby on Rails in general and HAML, so i'm trying to make a basic form that will post a string to the /query url. But I'm receiving the following error in my log:

> 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'

The code in question from my haml file:

!!!
%head
  = stylesheet_link_tag 'styleshe开发者_运维知识库et'
  %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

Anyone who can tell me whats missing?


The problem was the - on the form_tag elment. As Peter Wong said, it needs to be =

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜