This project is archived and is in readonly mode.
form_for fails for resources with no :index action
Reported by James A Rosen | January 17th, 2010 @ 11:11 PM | in 3.0.2
I declared a RESTful resource in my routes that only has
:show, :new, and :create
actions:
resources :foos, :only => [:show, :new, :create]
When I try to do a form_for(@foo), though, I get
"undefined method 'foos_path' for #<Class>."
This is because the resources call only creates a
foos_path if the :index action is
supplied.
I could, of course, simply define foos_path and
foos_url, but I think resources should be
smart enough to figure out to create those methods if
:create is supplied.
Comments and changes to this ticket
- 
        

José Valim January 18th, 2010 @ 08:42 AM
- Assigned user set to josh
 
Verified. This behavior is backwards incompatible with Rails 2.3.
 - 
        

José Valim January 18th, 2010 @ 08:06 PM
- Milestone cleared.
 
 - 
        

josh January 19th, 2010 @ 02:23 PM
- State changed from new to resolved
 
 - 
        

Jeremy Kemper October 15th, 2010 @ 11:01 PM
- Milestone set to 3.0.2
 - Importance changed from  to Low
 
 
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>