No route matches “/users/sign_out” devise rails 3

No route matches “/users/sign_out” devise rails 3

Asked on December 17, 2018 in Ruby on Rails.
Add Comment


  • 3 Answer(s)

    Solution:

    keyword: DELETE 

    <%= link_to "Sign out", destroy_user_session_path, :method => :delete %>
    
    

    The :method => :delete part  that  work you must also include <%= javascript_include_tag :defaults %> in your layout file (application.html.erb) .

    Answered on December 17, 2018.
    Add Comment

    Try this code:

    Changed this line into devise.rb:

    config.sign_out_via = :delete
    
    to

    config.sign_out_via = :get
    
    Answered on December 17, 2018.
    Add Comment

    Explanation:

    The latest version of jquery-ujs :

    rails generate jquery:install
    
    

    Make sure also this file is loaded with defaults, in config/application.rb:

    config.action_view.javascript_expansions[:defaults] = %w(jquery.min jquery_ujs)
    
    

    Finally you should not have rails.js file:

    = link_to('Logout', destroy_user_session_path, :method => 'delete')
    
    

    Answered on December 17, 2018.
    Add Comment


  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.