Skip to content

Commit

Permalink
Normalize route generation order: associations, yield block, then own…
Browse files Browse the repository at this point in the history
… routes.
  • Loading branch information
jeremy committed Aug 15, 2009
1 parent 1310231 commit df6617b
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions actionpack/lib/action_controller/routing/resources.rb
Expand Up @@ -531,31 +531,31 @@ def map_resource(entities, options = {}, &block)
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

def map_singleton_resource(entities, options = {}, &block)
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

Expand Down

0 comments on commit df6617b

Please sign in to comment.