This project is archived and is in readonly mode.
Uncountable inflections lead to exception with Rails 3 scaffolding
-
Samuel Danielson
I can confirm this bug. fish_url and fish_path will also raise
No route matches {:action=>"destroy", :controller=>"fish"}The following...
resources :fish, :singular => :fish_instancedoes not generate fish_instance_path and fish_instance_url as it did in Rails 2.3.5. Is there a work-around until this is fixed?
-
Jan De Poorter
- Tag changed from inflections, rails3, routingerror, scaffold to inflections, rails3, routing, routingerror, scaffold
This seems to be a routing issue rather then problems with scaffolding. I'm bumping into the same problem
-
Jan De Poorter
The attached patch should add _index to the uncountable resource (like it did in 2.3.5). This is only a partial solution to the scaffolding problem, but solves my problem with routes.
-
Yehuda Katz (wycats)
- Milestone cleared.
-
José Valim
- Assigned user set to josh
-
Rizwan Reza
- State changed from new to resolved
(from [cf6734fdf9d72bfc7fe92e36bf603d67ad815e6b]) Add more tests and docs to uncountable routes. [#3930 state:resolved] http://github.com/rails/rails/commit/cf6734fdf9d72bfc7fe92e36bf603d...
-
Rizwan Reza
(from [d6190c6dff33dce8e78e82d4a2578df444b46e65]) Add more tests and docs to uncountable routes. [#3930 state:resolved] http://github.com/rails/rails/commit/d6190c6dff33dce8e78e82d4a2578d...
-
Throlkim
I'm experiencing this same problem on Rails 3 beta 4. I have the following route:
resources :researchI receive the following error:
ActionController::RoutingError in Research#new No route matches {:action=>"destroy", :controller=>"research"} Extracted source (around line [#1](/projects/8994/tickets/1 "Ticket #1")): 1: <%= form_for @research, :as => :research do |f| %> 2: <% if @research.errors.any? %> 3: <div id="error_explanation"> 4: <h2><%= pluralize(@research.errors.count, "error") %> prohibited this research from being saved:</h2>Is there a way to resolve this, or is it still an ongoing bug?
-
Neeraj Singh
@Throlkim It works for me with latest master.
rails generate scaffold research title:string rake db:migrate rails server # visit http://localhost:3000/researchesI am able to visit index page and am able to create a new research.
-
Throlkim
@Neeraj, Did you set it up as uncountable? My route is http://localhost:3000/research :) I'm running the latest master too, as of last night methinks.
-
Christopher Redinger
Definitely still broken. Followed the steps laid out in #4898 and see the same problem. The problem is that polymorphic_url is mapping to the :show action for that form_for, when it should be mapping to the :create.
Possibly because it's matching /fish/:id, when it should be matching /fish/new?
-
Andrew White
Okay, here's a patch that should fix this issue.
-
José Valim
- Milestone cleared.
- State changed from resolved to open
- Assigned user changed from josh to José Valim
-
José Valim
- State changed from open to committed
-
José Valim
- No changes were found…
-
Repository
- State changed from committed to resolved
(from [ed3f042e99949526f483d1f567e40031deea33d3]) Make polymorphic_url and scaffolding work with uncountable resources [#3930 state:resolved]
Signed-off-by: José Valim jose.valim@gmail.com
http://github.com/rails/rails/commit/ed3f042e99949526f483d1f567e400...
