ok I think I figured it out, in my ApplicationController
def self.active_scaffold_controller_for(klass)
return "Admin#{klass}sController".constantize if klass == Tire ||
klass == Car
return "#{klass}ScaffoldController".constantize rescue super
end
On Mar 17, 2:05 pm, joelkeepup <[email protected]> wrote:
> Thanks, so how do I do this, lets say I have
>
> Car has many Tires
>
> and I have
>
> AdminCar and AdminTires controllers with active scaffold.
>
> I want admin stuff to be active scaffold, and regular stuff to be
> restful controllers and resources for end users.
>
> Seems to work, but when I click on AdminCar in active scaffold it
> looks for Tires instead of AdminTires and breaks.
>
> something like:
> ActiveScaffold::ControllerNotFound - TireController missing
> ActiveScaffold
>
> thanks
> Joel
>
> On Feb 17, 4:42 am, "Sergio Cambra .:: entreCables S.L. ::."
>
> <[email protected]> wrote:
> > On Martes, 16 de Febrero de 2010 20:45:46 joelkeepup escribió:
>
> > > Hi, im trying to use active scaffold for my internal admin tool and
> > > not my end user views. The problem is all my objects are related to
> > > each other. So if my models controller has active scaffold turned on,
> > > then it works fine in the admin view. If I turn it off, it works fine
> > > in the regular view, but breaks the active scaffold.
>
> > > For example, I have an admin model called "EndrollmentApplication".
> > > Only internal users can work on the enrollment application and I want
> > > it to be active scaffold. Its parent is a "Client". The client has an
> > > enternal view. Since they are related, I cant seem to make this work.
>
> > > any suggestions?
>
> > > seems like I should be able to use a before_filter, but im not sure
> > > how.
>
> > I always use two controllers, one for admin with active_scaffold, and
> > another
> > one for public access
>
> > --
> > Sergio Cambra .:: entreCables S.L. ::.
> > Mariana Pineda 23, 50.018 Zaragoza
> > T) 902 021 404 F) 976 52 98 07 E) [email protected]
--
You received this message because you are subscribed to the Google Groups
"ActiveScaffold : Ruby on Rails plugin" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/activescaffold?hl=en.