Topic: meta_search - undefined method name_contains

Recently I checked out meta_search and tried implemeting
I am using Ruby: 1.9.2, Rails: 3.0.6 and RubyGem: 1.6.23
I have product model and its columns are name, price..etc
Configured meta_where and meta_search in GemFile

index.html.erb
<%= form_for :search , @search, :url => products_path, :html => {:method => 'get'} do |f| %>
     <p>
           <%= f.label :name_contains %>
           <%= f.text_field :name_contains %><br />
     </p>
   <%= f.submit %>
<% end %>
<div id='products'><%=render 'products'%></div>

def index
@search = Product.search(params[:search])
@products = @search.all
end

I am getting  "undefined method name_contains for #<ActiveRecord::Relation:0x94749fc>" error.

Last edited by willm (2011-06-09 06:09:27)