model
def self.search(search)
if search
find(:all, :conditions => ['store_location_id LIKE :search ', {:search => "%#{search}%"}])
else
find(:all)
end
end
the store location name is what i have to search but i have only the id, how to search the name which is there in another StoreLocation model please help
but when we run the "rails g integration_test task" command it automatically generates the spec/requests folder so how to change it to spec/features folder? Please help
Hi i have to search the attributes which is there in some other model and i want to search multiple attributes
index view
<%= form_tag issue_slips_path, :method => 'get' do %>
<%= text_field_tag :search, params[:search] %>
<%= submit_tag "Search", :name => nil %>
<%end%>
controller
model
def self.search(search)
if search
find(:all, :conditions => ['store_location_id LIKE :search ', {:search => "%#{search}%"}])
else
find(:all)
end
end
the store location name is what i have to search but i have only the id, how to search the name which is there in another StoreLocation model please help
but when we run the "rails g integration_test task" command it automatically generates the spec/requests folder so how to change it to spec/features folder? Please help