使用 Ransack gem,我能够使用复选框对某些值进行搜索。但是,这不适用于多个复选框。我错过了什么?
看法:
<%= search_form_for @search do |f| %>
Part Time:<%= check_box_tag "q[job_type_cont]", value = "Part time" %></br>
Full Time:<%= check_box_tag "q[job_type_cont]", value = "Full time" %></br>
<%= f.submit "Search" %>
<% end %>
索引操作:
def index
@search = Job.search(params[:q])
@jobs = @search.result
end