I have a problem with a Rails app deployed on Heroku.
I have this link in the _header.html.erb file:
...
<li><%= link_to "Log out", logout_path, method: :delete %></li>
...
My logout_path is this one when typing rails routes
:
logout DELETE /logout(.:format) sessions#destroy
Now it works just right on local, but on Heroku it just doesnt. The problem is that on Heroku it tries to infer a GET on the logout path:
Heroku logs:
2018-08-17T16:34:16.490731+00:00 app[web.1]: (...) Started GET "/logout" for 84.147.254.28 at 2018-08-17 16:34:16 +0000
2018-08-17T16:34:16.491804+00:00 app[web.1]: (...) ActionController::RoutingError (No route matches [GET] "/logout"):
2018-08-17T16:34:16.492143+00:00 app[web.1]: (...) vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.1/lib/action_dispatch/middleware/debug_exceptions.rb:65:in `call'
Local logs:
Started DELETE "/logout" for 127.0.0.1 at 2018-08-17 18:44:51 +0200
Can someone help me with this, I dont know why it does that allthough I seemingly did everything like it should be done.
Thank you,
Jaiel
EDIT:
my application.js
//= require jquery
//= require bootstrap
//= require rails-ujs
//= require turbolinks
//= require_tree .