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.

Better syntax for form_for with namespaced routes

#6451

Instead of having

form_for([:backend, @team])

for namespaced resources, a nicer syntax would be

form_for(@team, :namespace => :backend)

or for nested namespaces

form_for(@team, :namespace => "backend/code_red")

Reported by avocade (at gmail) · February 18th, 2011 @ 04:39 PM

State: wontfix
Milestone: none
Assigned to: nobody
Importance: Low

Activity

  1. Jeff Kreeftmeijer
    Jeff Kreeftmeijer
    • Importance changed from to Low

    -1

    Maybe I'm not understanding correctly, but I don't think adding :namespace here is an improvement. Using [:namespace, :namespace, @item] seems more intuitive to me.

    Is there anything I'm missing? :)

    February 26th, 2011 @ 12:41 PM

  2. Andrew White
    Andrew White
    • State changed from new to wontfix

    Along with Jeff's comments there's also the issue of nested resources, e.g:

      form_for([@manufacturer, @product])
    

    If you can come up with a compelling use case (other than nicer syntax, which is subjective) then it can be reconsidered.

    March 5th, 2011 @ 06:26 PM