0

I've gone through many other stack overflow posts (e.g. this one: No route matches "/users/sign_out" devise rails 3), but I've not found anything that works.

Here's my view:

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

But when I click on the sign_out link, the server doesn't seem to process the "delete." It still thinks I want to a GET request.

Started GET "/users/sign_out" for 127.0.0.1 at 2011-10-03 20:45:54 -0400

ActionController::RoutingError (No route matches "/users/sign_out"):

I've also including the javascript tag that the other SO threads have mentioned in my application.html.erb:

<%= javascript_include_tag :defaults %>
<script src="/javascripts/jquery.js"></script>
<script src="/javascripts/jquery.tools.min.js"></script>    
<%= render 'layouts/stylesheets'%>

Totally at a loss.

Community
  • 1
  • 1
jyli7
  • 2,731
  • 6
  • 23
  • 31

1 Answers1

0

Try adding in gem 'jquery-rails' to your gem file, and run the generator as rails g jquery:install --ui to ensure that it installs JQueryUI as well as UJS. If it asks to overwrite any files just choose 'yes'.

Also change the above to <%= javascript_include_tag :all %>

Once this is done try it once more - good luck!

Michael De Silva
  • 3,808
  • 1
  • 20
  • 24
  • After I did everything you mentioned (and only after doing everything), it worked. Thanks! Can you please explain why I needed to make those changes? – jyli7 Oct 04 '11 at 18:05
  • As I last recall, you needed UJS for it work. In my experience, these steps have always fixed the issue for me in the past. – Michael De Silva Oct 04 '11 at 18:50