Excluding items from the railsadmin list view based on a field value

115 views
Skip to first unread message

Andrew Clarke

unread,
Nov 8, 2012, 12:32:09 PM11/8/12
to rails...@googlegroups.com
Hi,

Is there an simple way, i.e. within the rails_admin initializer or otherwise, to exclude items from the list view for a particular model in the RailsAdmin ui, based on the value of a particular field.

I want to exclude items with a status field set to say 'deleted' from being displayed in the RailsAdmin ui. (this allows me to clean up the ui without actually deleting any data from the db)

thanks for your time,

Andrew

Benoit Bénézech

unread,
Nov 12, 2012, 9:01:14 AM11/12/12
to rails...@googlegroups.com
Some managed to do just that by subclassing their model with a default_scope inside. They did have to hack a thing or two to make it work with path issues, if I remember well.

Francesco Rigotti

unread,
Jan 3, 2013, 8:05:02 AM1/3/13
to rails...@googlegroups.com
The approach Benoit is referring to is explained step by step in this post

Cheers
Reply all
Reply to author
Forward
0 new messages