标签: ruby-on-rails activeadmin
我可以在ActiveAdmin上的“产品”页面中添加按钮或点击过滤器,该页面仅显示偶数编号的ID吗?
由于
答案 0 :(得分:1)
class MyModel < ActiveRecord::Base scope :even_ids, -> { where('id%2 = 0') } end ActiveAdmin.register MyModel do scope :all, default: true scope :even_ids end