Parent::Children controller


You are correct in thinking that the admin/admin.rb file is screwing things up. Nested controllers seem to work best when you split your controllers in groups like: admin/xxx and admin/yyy. Your controllers would then be under xxx or yyy but not split with some being directly under admin. You need no special routing configuration to accomodate this.

Perhaps your best solution right now is to just forget about nesting the controllers and have it all under admin until you can see how changing this structure would serve you better.


Hi Paul, thanks for your help!

I've found something useful on the book: - It's about the config/routes.rb. In this file I can define when to use the post controller by adding these lines:

# Admin::Posts map.admin_posts 'admin/posts/:action/:id',   :controller => 'admin/posts',   :requirements => {     :id => /\d+/   }

That's it!

I forgot to paste the book name. :smiley:

"Agile Web Development with Rails"

Klaus Paiva wrote: