From 3a16b68368d4d4fdedb32c58d3c22d52203d07ce Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Mon, 1 May 2017 16:51:09 +0100 Subject: [PATCH] Use POST when editing GPX trace details Fixes #1533 --- app/views/trace/edit.html.erb | 2 +- config/routes.rb | 2 +- test/controllers/trace_controller_test.rb | 4 ---- 3 files changed, 2 insertions(+), 6 deletions(-) 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" } -- 2.43.2