This project is archived and is in readonly mode.

#6451 ✓wontfix
avocade (at gmail)

Better syntax for form_for with namespaced routes

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

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")

Comments and changes to this ticket

  • Jeff Kreeftmeijer

    Jeff Kreeftmeijer February 26th, 2011 @ 12:41 PM

    • 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? :)

  • Andrew White

    Andrew White March 5th, 2011 @ 06:26 PM

    • 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.

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Pages