Matt Richards
2006-Mar-29 10:04 UTC
[Rails] Grouping Controllers into Modules - Doesn''t work!?
Ok, what I want to achieve is: http://<mydomain>/admin/products calls app/controllers/admin/products_controller.rb According to Agile Development with Rails this should work. I executed the follwing commands: rails myproj cd myproj script/generate controller Admin script/generate scaffold Admin::Product this creates app/controllers/admin/products_controller.rb all the views & Product model, but doesnt actually route. http://<mydomain>/admin/products just gives me: Unknown action No action responded to product Any ideas? -- Posted via http://www.ruby-forum.com/.
szymek
2006-Mar-29 10:45 UTC
[Rails] Re: Grouping Controllers into Modules - Doesn''t work!?
You (probably) can''t have admin controller, because it''s the name of your group. If you want all your admin controllers have some common functionality, you can create admin_base controller (its name has to be different than ''admin'') and inherit all your admin controllers from this one. I don''t know if there''s any difference, but you can do Admin/Product instead of Admin::Product. -- Posted via http://www.ruby-forum.com/.
John Smilanick
2006-Mar-30 17:24 UTC
[Rails] Re: Grouping Controllers into Modules - Doesn''t work!?
I am trying to do the same thing, but I am not sure I want urls to look like: /admin/base/index Are there any decent alternatives? -John -- John Smilanick Computing Staff - Webmaster Kavli Institute for Theoretical Physics University of California, Santa Barbara jsmilani@kitp.ucsb.edu (805) 893-6307 On Mar 29, 2006, at 2:45 AM, szymek wrote:> You (probably) can''t have admin controller, because it''s the name of > your group. > If you want all your admin controllers have some common functionality, > you can create admin_base controller (its name has to be different > than > ''admin'') and inherit all your admin controllers from this one. > > I don''t know if there''s any difference, but you can do Admin/Product > instead of Admin::Product. > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060330/3cd3a729/attachment.html
Charlie Bowman
2006-Mar-30 17:31 UTC
[Rails] Re: Grouping Controllers into Modules - Doesn''t work!?
You can edit your routes.rb to make your urls look any way you want. On Thu, 2006-03-30 at 09:22 -0800, John Smilanick wrote:> I am trying to do the same thing, but I am not sure I want urls to > look like: /admin/base/index > > Are there any decent alternatives? > > > > -John > > > > -- > John Smilanick > Computing Staff - Webmaster > Kavli Institute for Theoretical Physics > University of California, Santa Barbara > jsmilani@kitp.ucsb.edu > (805) 893-6307 > > > > > > > On Mar 29, 2006, at 2:45 AM, szymek wrote: > > > > > You (probably) can''t have admin controller, because it''s the name > > of > > your group. > > If you want all your admin controllers have some common > > functionality, > > you can create admin_base controller (its name has to be different > > than > > ''admin'') and inherit all your admin controllers from this one. > > > > > > I don''t know if there''s any difference, but you can do > > Admin/Product > > instead of Admin::Product. > > > > > > -- > > Posted via http://www.ruby-forum.com/. > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/railsCharlie Bowman Programmer Castle Branch Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060330/00ebdd82/attachment-0001.html