I have the models foo1
, foo2
, foo3
and foo4
, which are subclasses of foo
. And I have models like bar
and baz
.
Models bar
and baz
contain objects of type foo
and of all its children. Also, each type has an action called next
.
Now I must setup routes like
resources :bar do
resources :foo do
member do
get :next
end
end
resources :foo1 do
member do
get :next
end
end
...
end
I could use concern
, to avoid setting the same to bar
and baz
, but I would still have to add get :next
to every subtype of foo
.
Is there some rails magic to do this that I'm not aware of?