Nested Resources + Namespace + Friendly URL

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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs