2
採用主動管理用ActiveRecord範圍在這裏解釋說:Rails3 Active Admin: How to display only Open status records when first click on Shipments tag?Rails的主動管理範圍使用參數
現在我想要使用參數做一個範圍。
在我的模型,我有:
#app/models/shipments.rb
scope :by_status, -> (status) { where(status: status) }
我希望能夠用這app/admin/shipments.rb
是像
# app/admin/shipments.rb
scope :by_status 'open'
有積極的管理辦法做到這一點?