RoR: how can I search only microposts with a specific attribute?
问题 Right now in app/views/microposts/home.html.erb I have.. <% form_tag purchases_path, :method => 'get', :id => "products_search" do %> <p> <%= text_field_tag :search, params[:search] %> <%= submit_tag "Search", :name => nil %> </p> <% end %> <% form_tag sales_path, :method => 'get', :id => "sales_search" do %> <p> <%= text_field_tag :search, params[:search] %> <%= submit_tag "Search", :name => nil %> </p> <% end %> and then in micropost.rb I have scope :purchases, where(:kind => "purchase")