0

我有一个相关模型的集合:一个结构 has_many 残基和一个残基 has_many 原子。我已经使用 belongs_to 关键字设置了我的 ActiveAdmin,例如

ActiveAdmin.register Residue do                                                                       
    belongs_to :structure
end

我想使用 ActiveAdmin 作为过滤数据库中实体的一种方式。例如,在结构索引页面上,我可以过滤任何列字段的结果,假设我根据结构名称进行过滤。我想获取这个结构列表,并查看所有相关的残基。然后,过滤这个残基列表,并查看所有相关的原子等。

通过阅读 ActiveAdmin 文档,看起来我可以使用批处理操作功能(http://www.activeadmin.info/docs/9-batch-actions.html)做这样的事情,但我不能似乎想通了。任何指针将不胜感激。

4

1 回答 1

0

你所有的模型之间的关系是什么?

您是否尝试在您的索引页面中添加更多这样的过滤器?

# Examples:
filter :structure_residue_name, :as => :string, :label => "Residue Name"
filter :structure_residue_atom_name, :as => :string, :label => "Atom Name"
于 2013-05-07T05:23:31.647 回答