small medium large xlarge

Generic-user-small
12 Nov 2008, 18:02
Christoph Ossner (9 posts)

Hello,

like the cenario on p.253, I have a seperate admin controller-group. For, for example users, I`ve got another controller (users_controller), wich is not part of that group. I want to use RESTful Interfaces to access those controllers. How can I do the map.resource for both, the admin/users_controller and the users_controller. It is because i want to use handy things like

<%= link_to 'Back', roles_path %>

Any suggestions?

Generic-user-small
12 Nov 2008, 19:39
Christoph Ossner (9 posts)

A change in the question:

Of course I dont`t want a RESTful interface for both controllers, but for one of them, the admin/users_controller. If i write to routes.rb

map.resources :users, :controller => '/admin/users'

I can`t access the functions of users_controller anymore, since everything will be routed to admin/

Generic-user-small
13 Nov 2008, 06:36
Christoph Ossner (9 posts)

I founde the solution in routes.rb

map.namespace :admin do |admin|
    admin.resources :users
end

This will result in routes like ‘admin_user’.

You must be logged in to comment