Use POST when editing GPX trace details

Fixes #1533
This commit is contained in:
Tom Hughes 2017-05-01 16:51:09 +01:00
parent 30392717b9
commit 3a16b68368
3 changed files with 2 additions and 6 deletions

View file

@ -4,7 +4,7 @@
<img src="<%= url_for :controller => 'trace', :action => 'picture', :id => @trace.id, :display_name => @trace.user.display_name %>">
<%= form_for @trace, :url => { :action => "edit" } do |f| %>
<%= form_for @trace, :method => :post, :url => { :action => "edit" } do |f| %>
<div id='edit-trace-form' class='standard-form'>
<fieldset>

View file

@ -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

View file

@ -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" }