views:

26

answers:

1

I have a namespaced controller like this:

class Shop::ProductsController < ApplicationController
  ...
end

I would like to route to this controller just as if it were not namespaced. ie. I would like to access this resource through the following URL:

/products

(ie. not /shop/products)

How can I set up this route in routes.rb

+2  A: 

Worked it out. Went to the source, which is what I should have done before asking this question. One of the great advantages of open source.

map.namespace :shop, :path_prefix => nil do |shop|
  shop.resources :products
end
Joel