# Admin namespace not working with duplicated action

**URL:** <https://www.ruby-forum.com/t/admin-namespace-not-working-with-duplicated-action/136292>\
**Category:** Rails\
**Created:** [April 30, 2008, 2:27pm UTC](https://www.ruby-forum.com/t/admin-namespace-not-working-with-duplicated-action/136292 "2008-04-30T14:27:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fipa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/9e8a1a/32.png) [@fipa](https://www.ruby-forum.com/u/fipa)\
**Post date:** [April 30, 2008, 2:27pm UTC](https://www.ruby-forum.com/t/admin-namespace-not-working-with-duplicated-action/136292/1 "2008-04-30T14:27:07Z")

</div>

Hi,

I have decided to setup my Rails app with a public and admin side.

To manage a list of users, I have a public  
app/controllers/users\_controller.rb where users can list there friends.

And an admin side: app/controllers/admin/users\_controller.rb where all  
registered users are listed and on which I can do some account  
management.

In the routes files I have:

map.resources :users

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

But when I click a link such as [http://mysite.com/admin/users](http://mysite.com/admin/users) which  
should send me to the admin users index action, instead I go to the  
public users/index action.

I have already setup this admin scheme for products, but in my admin  
controller I don’t have the index action, so it doesn’t interfere with  
the public one.

What else should I define?

---

<div class="post-metadata">

**Author:** ![fipa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/9e8a1a/32.png) [@fipa](https://www.ruby-forum.com/u/fipa)\
**Post date:** [April 30, 2008, 3:49pm UTC](https://www.ruby-forum.com/t/admin-namespace-not-working-with-duplicated-action/136292/2 "2008-04-30T15:49:51Z")

</div>

Please disregard my email, I simply had app/controllers/users.rb, I  
didn’t name the file correctly…
