small medium large xlarge

12 Nov 2008, 18:02
Christoph Ossner (9 posts)


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?

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/

13 Nov 2008, 06:36
Christoph Ossner (9 posts)

I founde the solution in routes.rb

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

This will result in routes like ‘admin_user’.

You must be logged in to comment