我有一个索引页面Users
,我想使用 MetaSearch 使用搜索表单进行过滤。但是,单击复选框时要搜索的值存储为字符串。例如,这是我想将 MetaSearch 应用到的表单:
<% form_for(current_user.profile) do |f| %>
<table id="careerCriteria">
<tr>
<td class="normal"><%= current_user.profile.hometown %></td>
<td><%= check_box_tag :hometown %></td>
</tr>
<tr>
<td class="normal"><%= current_user.profile.current_city %></td>
<td><%= check_box_tag :current_city %></td>
</tr>
<tr>
<td class="normal"><%= current_user.profile.past_city %></td>
<td><%= check_box_tag :past_city %></td>
</tr>
</table>
<% end %>
我的用户模型:
class User < ActiveRecord::Base
has_one :profile, :dependent => :destroy
end
我不想使用搜索按钮。我希望在单击复选框(或多个复选框)时应用过滤器。我是编程新手,所以任何帮助将不胜感激!