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>
<sc开发者_如何学编程ript src="/javascripts/jquery.tools.min.js"></script>
<%= render 'layouts/stylesheets'%>
Totally at a loss.
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!
精彩评论