delete method not support?
watsy0007 opened this issue · 3 comments
watsy0007 commented
eex(elixir render) code
<%= link "Delete", to: user_path(@conn, :delete, user), method: :delete, data: [turbolinks: true, remote: true], class: "btn btn-danger btn-xs" %>
html code
<a class="btn btn-danger btn-xs" data-csrf="Ym==" data-method="delete" data-remote="true" data-to="/users/6" data-turbolinks="true" href="/users/6">Delete</a>
pbmarcano commented
Look at #103 's last two answers and see if they help you. A little work is needed on the iOS side.
zachwaugh commented
Rails always sends DELETE
as a POST
to work in all browsers that may not support making DELETE
requests directly, using a hidden _method=DELETE
field:
Because submitting forms with HTTP methods other than GET and POST isn't widely supported across browsers, all other HTTP methods are actually sent over POST with the intended method indicated in the _method parameter. Rails automatically detects and compensates for this.
http://guides.rubyonrails.org/working_with_javascript_in_rails.html#data-method
watsy0007 commented
thanks @zachwaugh @pbmarcano