aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2009-08-15 15:56:52 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2009-08-15 15:56:52 -0700
commitdf6617bc8ac1677ab2b2cf7ed2859cdcc393ccb5 (patch)
treee8ce7c077b15f10a8064781d858acdec1314e64d /actionpack
parent1310231c15742bf7d99e2f143d88b383c32782d3 (diff)
downloadrails-df6617bc8ac1677ab2b2cf7ed2859cdcc393ccb5.tar.gz
rails-df6617bc8ac1677ab2b2cf7ed2859cdcc393ccb5.tar.bz2
rails-df6617bc8ac1677ab2b2cf7ed2859cdcc393ccb5.zip
Normalize route generation order: associations, yield block, then own routes.
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_controller/routing/resources.rb18
1 files changed, 9 insertions, 9 deletions
diff --git a/actionpack/lib/action_controller/routing/resources.rb b/actionpack/lib/action_controller/routing/resources.rb
index 4862cf7115..06506435a2 100644
--- a/actionpack/lib/action_controller/routing/resources.rb
+++ b/actionpack/lib/action_controller/routing/resources.rb
@@ -531,14 +531,14 @@ module ActionController
with_options :controller => resource.controller do |map|
map_associations(resource, options)
+ if block_given?
+ with_options(options.slice(*INHERITABLE_OPTIONS).merge(:path_prefix => resource.nesting_path_prefix, :name_prefix => resource.nesting_name_prefix), &block)
+ end
+
map_collection_actions(map, resource)
map_default_collection_actions(map, resource)
map_new_actions(map, resource)
map_member_actions(map, resource)
-
- if block_given?
- with_options(options.slice(*INHERITABLE_OPTIONS).merge(:path_prefix => resource.nesting_path_prefix, :name_prefix => resource.nesting_name_prefix), &block)
- end
end
end
@@ -546,16 +546,16 @@ module ActionController
resource = SingletonResource.new(entities, options)
with_options :controller => resource.controller do |map|
- map_collection_actions(map, resource)
- map_new_actions(map, resource)
- map_member_actions(map, resource)
- map_default_singleton_actions(map, resource)
-
map_associations(resource, options)
if block_given?
with_options(options.slice(*INHERITABLE_OPTIONS).merge(:path_prefix => resource.nesting_path_prefix, :name_prefix => resource.nesting_name_prefix), &block)
end
+
+ map_collection_actions(map, resource)
+ map_new_actions(map, resource)
+ map_member_actions(map, resource)
+ map_default_singleton_actions(map, resource)
end
end