From 0cac2806a6fd9f1f63cdce8d3fd1e86cefb22c1f Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Wed, 28 Mar 2007 21:55:40 +0000 Subject: Dropped the use of ; as a separator of non-crud actions on resources and went back to the vanilla slash. It was a neat idea, but lots of the non-crud actions turned out not to be RPC (as the ; was primarily intended to discourage), but legitimate sub-resources, like /parties/recent, which didn't deserve the uglification of /parties;recent. Further more, the semicolon caused issues with caching and HTTP authentication in Safari. Just Not Worth It [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6485 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_controller/resources.rb | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'actionpack/lib/action_controller') diff --git a/actionpack/lib/action_controller/resources.rb b/actionpack/lib/action_controller/resources.rb index d5aeaf1d45..506440c5c4 100644 --- a/actionpack/lib/action_controller/resources.rb +++ b/actionpack/lib/action_controller/resources.rb @@ -199,7 +199,7 @@ module ActionController # # * :collection -- add named routes for other actions that operate on the collection. # Takes a hash of #{action} => #{method}, where method is :get/:post/:put/:delete - # or :any if the method does not matter. These routes map to a URL like /messages;rss, with a route of rss_messages_url. + # or :any if the method does not matter. These routes map to a URL like /messages/rss, with a route of rss_messages_url. # * :member -- same as :collection, but for actions that operate on a specific member. # * :new -- same as :collection, but for actions that operate on the new resource action. # @@ -211,19 +211,19 @@ module ActionController # # --> GET /thread/7/messages/1 # # map.resources :messages, :collection => { :rss => :get } - # # --> GET /messages;rss (maps to the #rss action) + # # --> GET /messages/rss (maps to the #rss action) # # also adds a named route called "rss_messages" # # map.resources :messages, :member => { :mark => :post } - # # --> POST /messages/1;mark (maps to the #mark action) + # # --> POST /messages/1/mark (maps to the #mark action) # # also adds a named route called "mark_message" # # map.resources :messages, :new => { :preview => :post } - # # --> POST /messages/new;preview (maps to the #preview action) + # # --> POST /messages/new/preview (maps to the #preview action) # # also adds a named route called "preview_new_message" # # map.resources :messages, :new => { :new => :any, :preview => :post } - # # --> POST /messages/new;preview (maps to the #preview action) + # # --> POST /messages/new/preview (maps to the #preview action) # # also adds a named route called "preview_new_message" # # --> /messages/new can be invoked via any request method # @@ -331,8 +331,8 @@ module ActionController resource.collection_methods.each do |method, actions| actions.each do |action| action_options = action_options_for(action, resource, method) - map.named_route("#{resource.name_prefix}#{action}_#{resource.plural}", "#{resource.path};#{action}", action_options) - map.named_route("formatted_#{resource.name_prefix}#{action}_#{resource.plural}", "#{resource.path}.:format;#{action}", action_options) + map.named_route("#{resource.name_prefix}#{action}_#{resource.plural}", "#{resource.path}/#{action}", action_options) + map.named_route("formatted_#{resource.name_prefix}#{action}_#{resource.plural}", "#{resource.path}/#{action}.:format", action_options) end end end @@ -361,8 +361,8 @@ module ActionController map.named_route("#{resource.name_prefix}new_#{resource.singular}", resource.new_path, action_options) map.named_route("formatted_#{resource.name_prefix}new_#{resource.singular}", "#{resource.new_path}.:format", action_options) else - map.named_route("#{resource.name_prefix}#{action}_new_#{resource.singular}", "#{resource.new_path};#{action}", action_options) - map.named_route("formatted_#{resource.name_prefix}#{action}_new_#{resource.singular}", "#{resource.new_path}.:format;#{action}", action_options) + map.named_route("#{resource.name_prefix}#{action}_new_#{resource.singular}", "#{resource.new_path}/#{action}", action_options) + map.named_route("formatted_#{resource.name_prefix}#{action}_new_#{resource.singular}", "#{resource.new_path}/#{action}.:format", action_options) end end end @@ -372,8 +372,8 @@ module ActionController resource.member_methods.each do |method, actions| actions.each do |action| action_options = action_options_for(action, resource, method) - map.named_route("#{resource.name_prefix}#{action}_#{resource.singular}", "#{resource.member_path};#{action}", action_options) - map.named_route("formatted_#{resource.name_prefix}#{action}_#{resource.singular}", "#{resource.member_path}.:format;#{action}",action_options) + map.named_route("#{resource.name_prefix}#{action}_#{resource.singular}", "#{resource.member_path}/#{action}", action_options) + map.named_route("formatted_#{resource.name_prefix}#{action}_#{resource.singular}", "#{resource.member_path}/#{action}.:format",action_options) end end -- cgit v1.2.3