From 3d3ba58dbb2cfd4bbb0c1c868d754134a6f9ea3c Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Thu, 14 Sep 2006 19:53:04 +0000 Subject: remove implicit primary actions - more pain than gain. test collection actions for other http methods. strip whitespace. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5111 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_controller/resources.rb | 9 --------- 1 file changed, 9 deletions(-) (limited to 'actionpack/lib/action_controller') diff --git a/actionpack/lib/action_controller/resources.rb b/actionpack/lib/action_controller/resources.rb index dcc4c19c90..3fc9c326b4 100644 --- a/actionpack/lib/action_controller/resources.rb +++ b/actionpack/lib/action_controller/resources.rb @@ -225,7 +225,6 @@ module ActionController def map_collection_actions(map, resource) resource.collection_methods.each do |method, actions| - primary = actions.shift.to_s if method != :get route_options = requirements_for(method) actions.each do |action| @@ -241,11 +240,6 @@ module ActionController route_options.merge(:action => action.to_s) ) end - - unless primary.blank? - map.connect(resource.path, route_options.merge(:action => primary)) - map.connect("#{resource.path}.:format", route_options.merge(:action => primary)) - end end map.named_route("#{resource.name_prefix}#{resource.plural}", resource.path, :action => "index", :conditions => { :method => :get }) @@ -271,14 +265,11 @@ module ActionController def map_member_actions(map, resource) resource.member_methods.each do |method, actions| route_options = requirements_for(method) - primary = actions.shift.to_s unless [ :get, :post, :any ].include?(method) actions.each do |action| map.named_route("#{resource.name_prefix}#{action}_#{resource.singular}", "#{resource.member_path};#{action}", route_options.merge(:action => action.to_s)) map.named_route("formatted_#{resource.name_prefix}#{action}_#{resource.singular}", "#{resource.member_path}.:format;#{action}", route_options.merge(:action => action.to_s)) end - - map.connect(resource.member_path, route_options.merge(:action => primary)) unless primary.blank? end map.named_route("#{resource.name_prefix}#{resource.singular}", resource.member_path, :action => "show", :conditions => { :method => :get }) -- cgit v1.2.3