javascript - link_to with :method => :delete routing through GET not DELETE rails 4 -
i making ruby on rails app , have run problem believe has javascript in app not working.
the specific issue i'm having link_to:
<%= link_to 'sign out', destroy_user_session_path, :method => :delete %>
fairly standard can see.
i getting in console:
started "/user/sign_out" ::1 @ 2015-06-02
i think may have bootstrap , application.js file solution have found online have no helped.
here application.js file:
//= require bootstrap-sprockets //= require jquery //= require jquery_ujs //= require turbolinks //= require_tree .
earlier in app having similar issue deleting "space" entities within same app, , other similar js issue must that.
this on rails 4 way
the rails unobtrusive javascript driver (ujs) - jquery-rails
default uses intercepts clicks on links data-method
, sends ajax request either sends correct http method or fakes when client not support particular verb sending post request special _method
parameter.
this due fact html supports actions links , get|post
forms.
you have issue javascript such syntax error preventing ujs driver doing job. open console in browser.
Comments
Post a Comment