开发者

Rails search/checkbox logic

开发者 https://www.devze.com 2023-03-26 10:31 出处:网络
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.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消