No route matches "/users/sign_out" devise rails 3 -


i've installed devise on app , applied following in application.html.erb file:

<div id="user_nav">     <% if user_signed_in? %>         signed in <%= current_user.email %>. cannot cheese?         <%= link_to 'sign out', destroy_user_session_path %>     <% else %>         <%= link_to 'register', new_user_registration_path %> or <%= link_to 'sign in', new_user_session_path %>     <% end %> </div> 

i ran rake routes , confirmed routes valid.

also, in routes.rb file have devise_for :users , root :to => "home#index".

i following routing error when clicking "sign out" link:

no route matches "/users/sign_out" 

any ideas what's causing error?

i think route signing out delete method. means sign out link needs this:

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

yours doesn't include :method => :delete part. also, please note work must include <%= javascript_include_tag :defaults %> in layout file (application.html.erb).


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -