rails ransack下载搜索/过滤器

时间:2015-10-03 03:10:25

标签: ruby-on-rails search filter gem ransack

我有3种可能性的专栏,比如说(水果,蔬菜,肉)。我想用下拉过滤我的行,所以它只显示带有水果或蔬菜的行等。我一直在看ransack gem但是所有的例子都让你在文本字段中键入内容。我计划有几个下拉,以过滤其他列。搜索甚至是最好的方法吗?

1 个答案:

答案 0 :(得分:0)

struct intqq {
    int a[0];
    int len;
};

我将application_helper.rb中的options_for_poollength定义为

<%= f.select :poollength_eq, options_for_poollength, {:include_blank => "Select Pool Length"}, {:style => "width:175px", class: "form-control"} %>