Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

defaults routes for namespaces

#1024

Namespace support in routes is a little lacking, and if we want to support any form of defaults for our namespace, we have to rely on whatever default route we have setup.

This patch adds support for defaults within namespaces.

The following example now works:

map.namespace 'api' do |api|
  api.connect ':controller/:action/:id'
end

urls like: /api/product/list will now match to the api's default route.

Reported by Lori Holden · September 11th, 2008 @ 03:17 PM

State: resolved
Milestone: 3.x
Assigned to: Andrew White Andrew White
Importance: none

Activity

  1. Pratik
    Pratik
    • Assigned user set to Michael Koziarski
    • State changed from new to incomplete

    Hey Lori,

    The patch doesn't apply clean anymore. Could you please upload a new patch against the latest edge ?

    The feature seem reasonable to me.

    December 20th, 2008 @ 05:19 PM

  2. Lori Holden
  3. Jeremy Kemper
    Jeremy Kemper
    • Milestone changed from 2.x to 3.x

    May 4th, 2010 @ 06:48 PM

  4. Neeraj Singh
    Neeraj Singh
    • Assigned user changed from Michael Koziarski to Andrew White
    • Importance changed from to

    This is an old ticket. Since then a lot has changed in routing.

    Assigning it to Andrew to get his perspective.

    July 1st, 2010 @ 04:23 AM

  5. Andrew White
    Andrew White
    • State changed from incomplete to resolved

    Well, I wouldn't recommend adding a route like this but it does work now:

      namespace :api do
        match '/(:controller/(:action/(:id)))'
      end
    

    July 1st, 2010 @ 06:43 AM