]> git.openstreetmap.org Git - rails.git/commitdiff
Rails now defaults to using PATCH for updates
authorTom Hughes <tom@compton.nu>
Sun, 7 Jul 2013 18:24:18 +0000 (19:24 +0100)
committerTom Hughes <tom@compton.nu>
Sat, 21 Sep 2013 10:35:46 +0000 (11:35 +0100)
config/routes.rb
test/functional/trace_controller_test.rb

index 0b9a39d7e5675ea8ecc1ea477e63a0f793048570..514c6f756ba4b77ef065447c9fabaeb28a807dd3 100644 (file)
@@ -178,9 +178,9 @@ OpenStreetMap::Application.routes.draw do
   match '/traces/mine/page/:page' => 'trace#mine', :via => :get
   match '/traces/mine' => 'trace#mine', :via => :get
   match '/trace/create' => 'trace#create', :via => [:get, :post]
-  match '/trace/:id/data' => 'trace#data', :via => :get
-  match '/trace/:id/edit' => 'trace#edit', :via => [:get, :post, :put]
-  match '/trace/:id/delete' => 'trace#delete', :via => :post
+  match '/trace/:id/data' => 'trace#data', :via => :get, :id => /\d+/
+  match '/trace/:id/edit' => 'trace#edit', :via => [:get, :post, :patch], :id => /\d+/
+  match '/trace/:id/delete' => 'trace#delete', :via => :post, :id => /\d+/
 
   # diary pages
   match '/diary/new' => 'diary_entry#new', :via => [:get, :post]
index 600fd589f2da68d778ba30b4f50ba8e1b4fdff88..4c97a484921ea4e4d4ed0cdd9541131743857e3a 100644 (file)
@@ -141,7 +141,7 @@ class TraceControllerTest < ActionController::TestCase
       { :controller => "trace", :action => "edit", :id => "1" }
     )
     assert_routing(
-      { :path => "/trace/1/edit", :method => :put },
+      { :path => "/trace/1/edit", :method => :patch },
       { :controller => "trace", :action => "edit", :id => "1" }
     )
     assert_routing(