# Help with Namespaces

**URL:** <https://www.ruby-forum.com/t/help-with-namespaces/157497>\
**Category:** Rails\
**Created:** [January 12, 2009, 11:43am UTC](https://www.ruby-forum.com/t/help-with-namespaces/157497 "2009-01-12T11:43:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dr\_gavin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c37758/32.png) [@dr\_gavin](https://www.ruby-forum.com/u/dr_gavin)\
**Post date:** [January 12, 2009, 11:43am UTC](https://www.ruby-forum.com/t/help-with-namespaces/157497/1 "2009-01-12T11:43:49Z")

</div>

This is frustrating the hell out of me!

I have an application in which the controllers are split into two  
groups, public and private.

In my routes file, I’ve split them into namespaces:

map.namespace :private do |private|  
private.resources :batches  
private.resources :cities

…  
end

and so on.

When I run rake routes, it tells me what I expect to see:  
private\_batches GET /private/batches  
{:controller=\>“private/batches”, :action=\>“index”}

…

But if I go to /private/batches I get the error message:

No route matches “/private/batches” with {:method=\>:get}

It’s probably something really obvious that I’m missing but can anyone  
help out?

---

<div class="post-metadata">

**Author:** ![dr\_gavin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c37758/32.png) [@dr\_gavin](https://www.ruby-forum.com/u/dr_gavin)\
**Post date:** [January 12, 2009, 1:09pm UTC](https://www.ruby-forum.com/t/help-with-namespaces/157497/2 "2009-01-12T13:09:11Z")

</div>

Hi  
Can you try like  
./script/generate scaffold private/Batch  
./script/generate scaffold private/City

Then  
map.namespace :private do |private|  
private.resources :batches  
private.resources :cities  
end  
But you will have to reedit the helper methods in  
various html.erb files before make this to work

Sijo
