Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6765271
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:41:34+00:00 2026-05-26T14:41:34+00:00

Devise generated the following code to sign a user out: <%= link_to "Sign out",

  • 0

Devise generated the following code to sign a user out:

<%= link_to "Sign out", destroy_user_session_path %>

And the route appears when executing rake routes

destroy_user_session DELETE     /users/sign_out(.:format)
{:action=>"destroy", :controller=>"devise/sessions"} 

However I’m getting an error saying:

The action 'show' could not be found for UsersController

Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T14:41:34+00:00Added an answer on May 26, 2026 at 2:41 pm

    the path is correct but if you look closely you see that it’s not a GET request but a DELETE request so pass the method:

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

    Edit:

    This should add a data-method="delete" attribute to your link. Verify that (have a look at the generated HTML). If the attribute is present and nothing happens if you click on that link, then ensure that you’ve included the default javascript files in your layout. There should be a line like:

    <%= javascript_include_tag :defaults %>

    in your layout.

    >>Important<<: You can’t type the logout url into your address bar and hit enter, it won’t work because it’s a GET and not a DELETE request. The magic behind this is that a javascript helper will hook on to the “onclick” event of the link and then submit a hidden form (via POST) to the href destination of the url containing a hidden field called _method with the value “delete”.

    Why all this? It’s a security thing, otherwise someone could redirect you to the logout page and simply log you out and all your unsaved session stuff will be gone…

    If you reeeeaaaallllyyy need a logout via GET then add this to your

    config/initializers/devise.rb:

    config.sign_out_via = :get

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how Boost memory mapped files work. The following code
I use Rails 3.0.3 and devise 1.1.5 ( devise on github ) My User
Is the following code correct when passing the random generator state(CUDA toolkit 3.2 curand.lib)
I am using Devise :confirmable and :recoverable module to confirm a user and to
In devise invitable, the invite! method does the following: def invite! if new_record? ||
In the following code i am trying to have a text box and a
I am using the following code in Async-task ,for parsing a web-service and showing
I have the following issue. I'm using devise as an authentication module for my
Devise a simple algorithm which creates a file which contains nothing but its own
I am attempting to devise a system for packing integer values greater than 65535

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.