2012-04-07 30 views
0

末我寫了這個試圖索引數據問題索引,無端接正則表達式符合文件

= 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: 

回答

0

是的,這似乎是一個壓痕問題。你應該縮進一次%p和最後兩行的兩倍。

+0

確定現在我有一個盒子可以搜索,但是每當我寫一個作品並點擊搜索按鈕時,沒有任何變化,我已經索引了數據我猜 – Marina 2012-04-08 13:05:15

+0

marina @ ubuntu:〜$ cd項目 marina @ubuntu:〜/ project $ rake db:setup BlogPost的生成索引 – Marina 2012-04-08 13:06:19