Rails now defaults to using PATCH for updates

This commit is contained in:
Tom Hughes 2013-07-07 19:24:18 +01:00
parent 9ab8111022
commit bd8d207ea4
2 changed files with 4 additions and 4 deletions

View 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]

View 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(