Rails 3 routes admin section

Hello,

I’m trying to re-create the old route to the new route method in Rails
3, but i cannot figure out how to do it.

scope :admin, :name_prefix => “admin” do
resources :accounts, :users
end

this doesn’t give me “admin_controller” for “admin” path

and not “/admin/accounts” path for the resources

resources :admin do
resources :accounts, :users
end

this doesn’t fix the issue since it create those urls

admin/:admin_id/accounts etc.

namespace :admin do
resources :accounts, :users
end

neither this one, since it doesn’t allow me to have “admin_controller”

I hope you know what i need for now :smiley:

Thanks for any help…

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs