1
votes

I am using Devise for a large app with multiple engines and am looking for an alternative solution to the three options given below to destroy an user's session path:

  1. require jquery-ujs
  2. change config.sign_out_via = :delete to config.sign_out_via = :get
  3. use button_to instead of link_to

I'm currently require jquery-ujs and am able to successfully log out, but would prefer not to have to use this dependency for my solution.

= link_to 'Log Out', destroy_user_session_path, method: :delete

I will settle for require jquery-ujs if necessary, but am hoping someone out there knows another solution. Thanks!

1
you have all solutions here, if you dont accept any... I dont know what to sayapneadiving

1 Answers

0
votes

You can add an additional route to your app to point to the standard devise log out action.

devise_scope :user do
  get '/users/sign_out', to: 'devise/sessions#destroy'
end

Then you'll have log out via both DELETE and GET