How to move a group of controllers to a folder?

I created a forest group with the edited code inside, but now I want to move these controller groups to a folder, say its admin name. How to do it?

I put Admin:: in the controller already, moved them to the folder already, but there is still an error.

+7
ruby-on-rails
source share
1 answer

The part I don't see above is what you say with the Rails engine. This is probably what you are missing. If you use Rails 3, I wrote an article about this:

Routing in Ruby on Rails 3

The Routes with Names section details how to configure mapping in the routes file. Here is a sample code:

 namespace :admin do resources :posts end 

You already have other parts. If you are using Rails 2.x, try this instead:

 map.namespace(:admin) do |admin| admin.resources :posts end 

I admit that I have not tried this last piece, but it looks solid. Hope this helps!

+5
source share

All Articles