Skip to content

Commit

Permalink
Use POST when editing GPX trace details
Browse files Browse the repository at this point in the history
Fixes #1533
  • Loading branch information
tomhughes committed May 1, 2017
1 parent 3039271 commit 3a16b68
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/views/trace/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@
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
Expand Down
4 changes: 0 additions & 4 deletions test/controllers/trace_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,6 @@ def test_routes
{ :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" }
Expand Down

0 comments on commit 3a16b68

Please sign in to comment.