I am trying to create some search function.
I do want users to be able to check checkboxes.
When the form submitted the 开发者_开发知识库ID of the companies should be send as params to a given URL.
In my controller i need to create some search action, I just dont know how to params are gonna be.
def search
@companyies = Company.find(find all the companies that match the params)'
end
How should I create the checkbox loop? How should I create the search action?
Regarding the use of check boxes, this might be of some help to you.
A Railscast by Ryan Bates
Instead of rolling your own search system, you may have better luck using something like searchlogic that does most of this for you.
精彩评论