I have this route:
scope :module => :mobile, :as => :mobile do
constraints(:subdomain => /m/) do
devise_for :users, :path => "", :path_names =>
{ :sign_in => "login", :sign_out => "logout",
:sign_up => "signup" },
:controllers => {:sessions => "mobile/sessions"}
...
So I figured this would be my link to log out:
=link_to("Log Out", logout_url)
But that is giving the error:
undefined local variable or method `logout_url' for #<#<Class:0x134881e88>:0x134879a08>
any idea how I can get the link to point correctly?
Thanks!
If you check out
rake routesyou will notice that you have a route that looks likedestroy_user_session.Also, the route will only work if it’s using the delete http method.
link_to "Log out", destroy_user_session_url, :method => :delete