title: Devise: Why doesn't my logout link work?
body: <p>the problem: In a nutshell, when I try to install a logout link to my app it fails to work. Here's as much context as I can think to put here (if you want anything else, please poke me)...</p>
  
  <p>I've got this in a haml view:</p>
  
  <pre><code>= link_to("Logout", destroy_user_session_path, :method =&gt; :delete)
  </code></pre>
  
  <p>It generates this in the view:</p>
  
  <pre><code>&lt;a href="/users/sign_out" data-method="delete" rel="nofollow"&gt;Logout&lt;/a&gt;
  </code></pre>
  
  <p>I verified that in my config/initializers/devise.rb I have this setting uncommented and correct:</p>
  
  <pre><code>config.sign_out_via = :delete
  </code></pre>
  
  <p>I validated the following route:</p>
  
  <pre><code>destroy_user_session DELETE /users/sign_out(.:format) {:action=&gt;"destroy", :controller=&gt;"devise/sessions"}
  </code></pre>
  
  <p>I also have this bit of trickery in my routes.rb, and I suspect this is related to my issue:</p>
  
  <pre><code>devise_for :users, :controllers =&gt; {:sessions =&gt; "devise/sessions", :registrations =&gt; "users"}
  resources :users
  </code></pre>
  
  <p>This last bit is because I want to manage (edit, create and delete) users in my own controller. </p>
  
  <p>The error message I'm getting is as follows: </p>
  
  <pre><code>ActiveRecord::RecordNotFound in UsersController#show
  
  Couldn't find User with ID=sign_out
  Rails.root: /home/jaydel/projects/mbsquared-projects/Wilson-Goldrick
  
  app/controllers/users_controller.rb:16:in `show'
  </code></pre>
  
  <p>In my server logs I see this for the request:</p>
  
  <pre><code>Started GET "/users/sign_out" for 127.0.0.1 at 2011-08-04 13:08:51 -0500
    Processing by UsersController#show as HTML
    Parameters: {"id"=&gt;"sign_out"}
  </code></pre>
  
  <p>Anyone have any ideas?</p>