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.

Rails 3.0b3 and 3.0b4: :as option in resource router fails

#4814

In Rails 2.3.5,

  1. create an app
  2. ./script/generate scaffold Post title:string body:string
  3. In routes.rb, add :as => :widgets to map.resources :posts
  4. http://localhost:3000/widgets shows your resource

In Rails 3.0b4 (and b3),

  1. create an app
  2. rails g scaffold Post title:string body:string
  3. In routes.rb, add :as => :widgets to map.resources :posts
  4. http://localhost:3000/widgets throws a RoutingError

Reported by Bob Lail · June 9th, 2010 @ 07:35 PM

State: invalid
Milestone: none
Assigned to: Santiago Pastorino Santiago Pastorino
Importance: Low

Activity

  1. Neeraj Singh
    Neeraj Singh

    In rails3 :as option can be used to map to a different controller.

    resources :photos, :as => "images"
    

    Now /photos will map to images_path

    The option you are looking for is :path.

    resources :posts, :path => :widgets
    

    June 10th, 2010 @ 07:16 PM

  2. Rohit Arondekar
    Rohit Arondekar
    • Assigned user set to Santiago Pastorino

    June 11th, 2010 @ 10:43 AM

  3. Ryan Bigg
    Ryan Bigg
    • State changed from new to invalid

    June 12th, 2010 @ 02:54 AM