我正在使用wice_grid,并在gem的instruction之后为两个关联模型定义了自定义过滤器。我有:
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
这会产生错误:
Couldn't find Organization with 'id'=all
知道我做错了吗?
答案 0 :(得分:0)
使用Organization.all
。最新版本的rails
find(:all)