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.

form_for is resolving a plural instance for a singlar resource

#3734

I have this route

map.namespace :admin do |m|
  m.resource :global
end

usage:

form_for [:admin, Global.instance] do |f|
  ...

In rails 2.3.5 this works fine, in rails 3 it is resolving the array incorrectly to admin_globals_path which causes a failure.

Reported by Sam Saffron · January 18th, 2010 @ 04:17 AM

State: wontfix
Milestone: 3.0.2
Assigned to: josh josh
Importance: Low

Activity

  1. José Valim
    José Valim
    • Assigned user set to josh

    January 18th, 2010 @ 08:38 AM

  2. José Valim
  3. josh
    josh
    • State changed from new to wontfix

    Putting any model into form_for won't "just work" anymore. Your model needs to follow the ActiveModel api. I'm guessing extending the model with "ActiveModel::Naming" should fix the issue. So make sure "Global.instance.model_name" works.

    January 19th, 2010 @ 02:27 PM

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

    October 15th, 2010 @ 11:01 PM