[英]Custom filter for grid view not working: Couldn't find with 'id'=all
I am using wice_grid and have defined a custom filter for two associated models, following the instruction of the gem. 我正在使用wice_grid,并按照gem的说明为两个关联的模型定义了一个自定义过滤器。 I have: 我有:
g.column name: 'Organization', filter_type: :string, attribute: 'name', model: 'Organization', auto_reload: true, html: {id: 'grid-cells'},
custom_filter: Organization.find(:all).map{|pr| [pr.name, pr.name]} do |user|
link_to(user.organization.name, organization_path(user.organization))
end
This generates the error: 这将产生错误:
Couldn't find Organization with 'id'=all
Any idea what I'm doing wrong? 知道我在做什么错吗?
Use Organization.all
. 使用Organization.all
。 find(:all)
is deprecated in latest version of rails 在最新版本的rails中不推荐使用find(:all)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.