aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/polymorphic_routes.rb
diff options
context:
space:
mode:
authorAndrew White <andyw@pixeltrix.co.uk>2010-06-19 22:35:54 +0100
committerJosé Valim <jose.valim@gmail.com>2010-06-20 00:15:41 +0200
commited3f042e99949526f483d1f567e40031deea33d3 (patch)
treec8c4332b2d93be2a39202bf49a556586bc354cd0 /actionpack/lib/action_controller/polymorphic_routes.rb
parent65ce3d12971afd15de6ea22a2fc5af3ba1faf124 (diff)
downloadrails-ed3f042e99949526f483d1f567e40031deea33d3.tar.gz
rails-ed3f042e99949526f483d1f567e40031deea33d3.tar.bz2
rails-ed3f042e99949526f483d1f567e40031deea33d3.zip
Make polymorphic_url and scaffolding work with uncountable resources [#3930 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'actionpack/lib/action_controller/polymorphic_routes.rb')
-rw-r--r--actionpack/lib/action_controller/polymorphic_routes.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/polymorphic_routes.rb b/actionpack/lib/action_controller/polymorphic_routes.rb
index 7f2eb4306b..bee50a7a3b 100644
--- a/actionpack/lib/action_controller/polymorphic_routes.rb
+++ b/actionpack/lib/action_controller/polymorphic_routes.rb
@@ -11,7 +11,7 @@ module ActionController
# polymorphic_url([:admin, @article, @comment])
#
# results in:
- #
+ #
# admin_article_comment_url(@article, @comment)
#
# == Usage within the framework
@@ -166,6 +166,7 @@ module ActionController
route << RecordIdentifier.__send__("plural_class_name", record)
route = route.singularize if inflection == :singular
route << "_"
+ route << "index_" if RecordIdentifier.uncountable?(record) && inflection == :plural
end
action_prefix(options) + route + routing_type(options).to_s