Error Message
Rails Server
Processing by Devise::SessionsController#destroy as HTML
User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]]
Can't verify CSRF token authenticity
(0.4ms) BEGIN
(0.1ms) COMMIT
I read this article thoroughly, my question is not a repeat because I researched!
I tried Cramheads suggestion: Added this to routes.rb
devise_for :users do
get '/users/sign_out' => 'devise/sessions#destroy'
end
I tried itkevins suggestion: changed devise.rb's default from
config.sign_out_via = :delete
to
config.sign_out_via = :get
this resulted in a routing error:
uninitialized constant UsersController
I tried Rickys suggestion: changed devise.rb
config.sign_out_via_get_becuase_of = :ie
this resulted in a method error:
undefined method `sign_out_via_get_because_of=' for Devise:Module (NoMethodError)
I tried Olives suggestion: adjusted the code slightly
link_to :logout, destroy_user_session_path, :method => :delete
replacing
link_to "Sign out", destroy_user_session_path, :method => :delete
I tried Victor Martins suggestion: Already had this in application.js
//= require jquery
//= require jquery_ujs
I tried Rezas suggestion: In routes.rb
devise_for :users
devise_scope :user do
get '/users/sign_out' => 'devise/sessions#destroy'
end
I followed DuyKhoas suggestion as well: I included javascript
<%= javascript_include_tag(:application) %>
I already had this so this wasn’t helpful either.
All the other suggestions were repeats of the already suggested fixes.
HELP PLEASE! t.T
You can look at the Github Repo here.