sferik/rails_admin — Issue #978: Hiding STI parent class
Author: chewi
Created: 2012-02-11 16:24:36+00:00
State: open

I used to list my STI subclasses directly in the model list. I just updated rails_admin and found that these would no longer appear unless I also included their parent class. The problem is that this is essentially an abstract class. The subclasses do share a single table but I cannot come up with a single form that would sensibly represent them all. I can use CanCan to prevent the creation of parent class instances but then I also have to explicitly allow subclass instances to be created. This doesn't seem to work for editing, which wouldn't be a problem if only it linked to the subclass form instead of the parent class form. Does polymorphic_url from Rails help here? Of course, some people may want to link to the parent class form. There needs to be some kind of option here.