On Martes, 16 de Noviembre de 2010 18:17:07 Soren Christensen escribió: > Hi, > > I need to have multiple interfaces to the same model for usability reasons. > > The obvious solution is to have multiple controllers for the same model, > and then use the conditions_for_collection to select the appropriate > elements from the model. > > As far as I can see this will not break anything, but is there a better > solution ? > > /S
Another way is to have one controller and set conditions according to query parameters. For example: http://host/controller?filter=active http://host/controller?filter=pending And set conditions for filter=active and filter=pending in conditions_for_collection. You can use pretty urls too: config.resource :active_resource, :controller => 'resource_controller', :requirements => {:filter => 'active'} config.resource :pending_resource, :controller => 'resource_controller', :requirements => {:filter => 'pending'} -- 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.
