From: Tom Hughes Date: Mon, 1 May 2017 15:51:09 +0000 (+0100) Subject: Use POST when editing GPX trace details X-Git-Tag: live~4019 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/3a16b68368d4d4fdedb32c58d3c22d52203d07ce?ds=sidebyside;hp=-c Use POST when editing GPX trace details Fixes #1533 --- 3a16b68368d4d4fdedb32c58d3c22d52203d07ce diff --git a/app/views/trace/edit.html.erb b/app/views/trace/edit.html.erb index da273b0eb..935862af4 100644 --- a/app/views/trace/edit.html.erb +++ b/app/views/trace/edit.html.erb @@ -4,7 +4,7 @@ -<%= form_for @trace, :url => { :action => "edit" } do |f| %> +<%= form_for @trace, :method => :post, :url => { :action => "edit" } do |f| %>
diff --git a/config/routes.rb b/config/routes.rb index 59c0dac86..a9767231f 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -208,7 +208,7 @@ OpenStreetMap::Application.routes.draw do match "/traces/mine" => "trace#mine", :via => :get match "/trace/create" => "trace#create", :via => [:get, :post] match "/trace/:id/data" => "trace#data", :via => :get, :id => /\d+/, :as => "trace_data" - match "/trace/:id/edit" => "trace#edit", :via => [:get, :post, :patch], :id => /\d+/, :as => "trace_edit" + match "/trace/:id/edit" => "trace#edit", :via => [:get, :post], :id => /\d+/, :as => "trace_edit" match "/trace/:id/delete" => "trace#delete", :via => :post, :id => /\d+/ # diary pages diff --git a/test/controllers/trace_controller_test.rb b/test/controllers/trace_controller_test.rb index bbd26bf27..9821352e1 100644 --- a/test/controllers/trace_controller_test.rb +++ b/test/controllers/trace_controller_test.rb @@ -157,10 +157,6 @@ class TraceControllerTest < ActionController::TestCase { :path => "/trace/1/edit", :method => :post }, { :controller => "trace", :action => "edit", :id => "1" } ) - assert_routing( - { :path => "/trace/1/edit", :method => :patch }, - { :controller => "trace", :action => "edit", :id => "1" } - ) assert_routing( { :path => "/trace/1/delete", :method => :post }, { :controller => "trace", :action => "delete", :id => "1" }