0

The error i am getting

No route matches [GET] "/retailers/sign_out"

my routes file

  devise_for :retailers
  devise_for :suppliers
  devise_for :admins, skip: [:registration]

And the rake routes

destroy_retailer_session_path   DELETE  /retailers/sign_out(.:format) devise/sessions#destroy

Why can't i sign out?

suyesh
  • 530
  • 7
  • 23
  • You are calling the signout via GET, but based on rake routes it only supports DELETE – Chris Jan 06 '16 at 20:42
  • See this for reference http://stackoverflow.com/questions/6557311/no-route-matches-users-sign-out-devise-rails-3 – Chris Jan 06 '16 at 20:45
  • i have this in my view `
  • <%= link_to "Log Out", destroy_retailer_session_path,method: :delete%>
  • ` – suyesh Jan 06 '16 at 20:45
  • First verify you are requiring rails_ujs in your application.js file . Is your link_to is in a hidden or not created panel called by javascript? For instance, if you have a hidden fly-out panel someone clicks on which unhides it or renders it - then click log ? – trh Jan 06 '16 at 20:49
  • Whoa this worked. THANKS. – suyesh Jan 06 '16 at 20:53
  • heh, glad you got it - should be jquery_ujs, not rails ujs. but you seem to have resolved that. – trh Jan 06 '16 at 20:57
  • Yes it was jquery ujs. You are awesome. – suyesh Jan 06 '16 at 21:00