将局部变量传递给Rails 4中用于Ransack关联的部分层次结构
我正在尝试使用Ransack在我的所有模型的索引页面上实现搜索和排序表单。 我想尽可能干这样做,所以我在views / application文件夹中创建了三个部分:
- 视图/应用/ _table_search_and_sort_form.html.erb
- 视图/应用/ _condition_fields.html.erb
- 视图/应用/ _sort_fields.html.erb
每个代码如下:
视图/应用/ _table_search_and_sort_form.html.erb
视图/应用/ _condition_fields.html.erb
<div class="field" data-object-name="">