javascript - Rails form does POST instead of DELETE after adding in Bootstrap? -
i added functionality sort table columns following lines of code:
<table data-toggle="table" class= "table"> . . . <th data-sortable = "true"> header column </th> . . <%= form_tag(sccm_destroy_multiple, method: :delete) %> . . . <%end%>
so after added in data-toggle="table"
, data-sortable="true"
lines (was working fine before added those), form started making post requests instead of delete, ideas how fix this?
also:
application.js:
//= require bootstrap-table
can post html generated form page?
according the docs, should have following hidden field. see field?
<form accept-charset="utf-8" action="/sccm_destroy_multiple" method="post"> <input name="_method" type="hidden" value="delete" />
the rails framework encourages restful design of applications, means you'll making lot of "patch" , "delete" requests (besides "get" , "post"). however, browsers don't support methods other "get" , "post" when comes submitting forms.
rails works around issue emulating other methods on post hidden input named "_method", set reflect desired method:
Comments
Post a Comment