On Domingo, 4 de Octubre de 2009 23:50:01 JoshK escribió: > I installed activescaffold in order to get an administrative backend > "for free" but I'm not really sure how to set it up to do what I need. > > Seems like activescaffold is supposed to work against controllers > named for the object they control, i.e. replace my > ProductsController based on my model object "Product" with a call to > Active_Scaffold :product. > > But if I do that, where do I put the code that I am using now to show > products to customers? The scaffold views are great for letting me > update stuff on the backend, but I obviosuly don't want customers > changing or even viewing a lot of the data that is exposed by active > scaffold. > > I know I can create an "AdminProductsController" that only admins can > access, but this will only surface data from the products table, and > doesn't work for related tables like "supplier" unless I dump the > controllers for those objects as well. > > So I guess my question is, what's the right way to create "customer > facing" pages as well as "administration" pages against the same set > of objects?
The easiest way is to create controllers for each resource in a Admin module (put them under app/controllers/admin directory) class Admin::ProductsController class Admin:SuppliersController and so on -- 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 -~----------~----~----~----~------~----~------~--~---
