索引问题,未终止的regexp遇到文件结尾

时间:2012-04-07 22:04:40

标签: haml

我在尝试索引数据时写了这个

= form_tag blog_posts_path, method: :get do
%p
= text_field_tag :query, params[:query]
= submit_tag "Search", name: nil

我收到此错误,我真的不知道如何修复它:

/home/marina/project/app/views/blog_posts/index.haml:15: syntax error, unexpected ')'
));}\n<p></p>\n#{
 ^
/home/marina/project/app/views/blog_posts/index.haml:15: syntax error, unexpected '<'
));}\n<p></p>\n#{
      ^
/home/marina/project/app/views/blog_posts/index.haml:15: unterminated regexp meets end of fail
/home/marina/project/app/views/blog_posts/index.haml:15: syntax error, unexpected $end, expecting keyword_end

提取的来源(第15行):

12: %br
13: 
14: = form_tag blog_posts_path, method: :get do
15: %p
16: = text_field_tag :query, params[:query]
17: = submit_tag "Search", name: nil
18: 

1 个答案:

答案 0 :(得分:0)

是的,这似乎是一个缩进问题。你应该在%p和最后两行两次缩进。