2012-04-08 3 views
0

Immer wenn ich versuche, ein Wort zu schreiben, um es zu suchen, bekomme ich nichts, als ob der Button von Search diascled ist. Ich habe meinen Blogpost bereits indiziert.Die Suche-Taste funktioniert nicht in elasticsearch mit Tire

this is for search 
%h1 My Blog 

= form_tag blog_posts_path, method: :get do 
    %p  
= text_field_tag :query, params[:query] 
= submit_tag "Search", name: nil 
- @blog_posts.each do |blog_post| 
    %p 
    %b= link_to blog_post.title, blog_post 

    %p= blog_post.content 

    %p{style: "float: right;"} 
    = link_to "Delete", blog_post, method: :delete, confirm: "Are you sure you want to delete this post?" 
    %hr{style: "clear: both;"} 

%br 

= link_to 'New Post', new_blog_post_path 

und diese Indizierung marina @ ubuntu: ~/Projekt $ rake db: setup generiert Indizes für Blogpost

Antwort

0

Versuchen die text_field_tag und die submit_tag unterhalb des form_tag nisten, diese in Ihrem Code sind Geschwisterknoten .

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