# Nested Resources + Namespace + Friendly URL

**URL:** <https://www.ruby-forum.com/t/nested-resources-namespace-friendly-url/184790>\
**Category:** Rails\
**Created:** [March 8, 2010, 6:55pm UTC](https://www.ruby-forum.com/t/nested-resources-namespace-friendly-url/184790 "2010-03-08T18:55:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ronald\_Rails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e8c25b/32.png) [@Ronald\_Rails](https://www.ruby-forum.com/u/Ronald_Rails)\
**Post date:** [March 8, 2010, 6:55pm UTC](https://www.ruby-forum.com/t/nested-resources-namespace-friendly-url/184790/1 "2010-03-08T18:55:03Z")

</div>

Hi, all

In my rails app I have a controller called Dashboard::MenusController  
with a namespace dashboard.  
I have a model Company too, where its has\_many :menus

So, I have the code above in my route.rb

map.namespace (:dashboard) do |dashboard|  
dashboard.resources :companies,  
:has\_many =\> :menus  
end

With this route I can create a new menu by: dashboard/companies/1/  
menus/new

I would like to know, how can I hide the \<companies/1\> parameters,  
becouse the company is gonna be logged in my apps, and my apps already  
gets your ID from the session, instead of to get from URL

I would like to have: dashboard/menus/new

Above is my code for to take a ID of the company

before\_filter :load\_company

def load\_company  
@company = Company.find(current\_company.id)  
end

Thanks
