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.

naming problem in nested singular resource

#3911

When nesting singular resources the naming is off. Instead of having resource1_resource2_path, I just get resource2_path method for the route.

In Rails 2.3 syntax

map.resource :account do |acc|
 acc.resource :payment_plan
end

Which results in

 new_account_payment_plan GET    /account/payment_plan/new(.:format)                        {:controller=>"payment_plans", :action=>"new"}
edit_account_payment_plan GET    /account/payment_plan/edit(.:format)                       {:controller=>"payment_plans", :action=>"edit"}
     account_payment_plan GET    /account/payment_plan(.:format)                            {:controller=>"payment_plans", :action=>"show"}
                          PUT    /account/payment_plan(.:format)                            {:controller=>"payment_plans", :action=>"update"}
                          DELETE /account/payment_plan(.:format)                            {:controller=>"payment_plans", :action=>"destroy"}
                          POST   /account/payment_plan(.:format)                            {:controller=>"payment_plans", :action=>"create"}

Rails 3 syntax

resource :account do
  resource :payment_plan
end

which results in

                          GET    /account/payment_plan(.:format)                            {:controller=>"payment_plans", :action=>"show"}
                          POST   /account/payment_plan(.:format)                            {:controller=>"payment_plans", :action=>"create"}
                          PUT    /account/payment_plan(.:format)                            {:controller=>"payment_plans", :action=>"update"}
             payment_plan DELETE /account/payment_plan(.:format)                            {:controller=>"payment_plans", :action=>"destroy"}
         new_payment_plan GET    /account/payment_plan/new(.:format)                        {:controller=>"payment_plans", :action=>"new"}
        edit_payment_plan GET    /account/payment_plan/edit(.:format)                       {:controller=>"payment_plans", :action=>"edit"}

Reported by Jan De Poorter · February 9th, 2010 @ 03:00 PM

State: committed
Milestone: 3.0.2
Assigned to: nobody
Importance: Low

Activity

  1. Jan De Poorter
  2. Prem Sichanugrist (sikachu)
    Prem Sichanugrist (sikachu)
    • State changed from new to open
    • Milestone cleared.

    I've found this bug too. Will try to apply the bug later today. Will get back to you soon :)

    February 12th, 2010 @ 10:59 AM

  3. Repository
    Repository
    • State changed from open to committed

    March 7th, 2010 @ 10:37 PM

  4. Jeremy Kemper
    Jeremy Kemper
    • Milestone set to 3.0.2
    • Importance changed from to Low

    October 15th, 2010 @ 11:01 PM