Hey guys. I noticed in an example from the active scaffold documentation that it seems to be possible to put rails controllers in modules, a la "class Admin::CompaniesController < ApplicationController". Does anyone know anything about this? What do you name the file? Do you put it in a subdirectory? Thanks.
on 2007-05-30 13:21
on 2007-05-30 15:54
Hi, Just: script/generate model controlelr admin::companies And that is was! It will create a controller named CompanyController in a subdir named admin. From the ruby point of view, CompanyController belongs to admin namespace (class Admin::CompanyController) Regards, Jean-Etienne http://www.woa.hu
on 2007-05-31 05:14
thanks, thats very helpful. one more question: what address does this get mapped to? ../admin/companies doesn't seem to work...? On May 30, 6:54 am, Jean-Etienne D. <rails-mailing-l...@andreas-
on 2007-06-02 09:39
Funny, I just started using this and wanted to understand exactly that. I can't test it in my app right now, but I'd venture a guess that it would map to: admin/company/ Here's a question... I notice you're running the model generator as well. Does that mean I would not be able to "share" a Company model between two different controller namespaces, say Admin::CompanyController and Guest::CompanyController? Best regards, Mauricio --- Mauricio L. Sadicoff firstname.lastname@example.org "Peace of mind isn't at all superficial, really," I expound. "It's the whole thing. That which produces it is good maintenance; that which disturbs it is poor maintenance. What we call workability of the machine is just an objectification of this peace of mind. The ultimate test is always your own serenity." - Zen and the Art of Motorcycle Maintenance.