Hello,
My name is Javier Molina and I am programming a simple app to manage users in Ruby on Rails.
I read RoR Tutorial from http://ruby.railstutorial.org/chapters/sign-in-sign-out#top to sign in and sign out my app. I implemented the same configuration as it said:
sessions_helper.rb
def sign_out
self.current_user = nil
cookies.delete(:remember_token)
end
sessions_controller.rb
def destroy
sign_out
redirect_to root_url
end
application.html.erb
<%= link_to “Sign out”, signout_path, method: “delete” %>
routes.rb
match ‘/signout’, to: ‘sessions#destroy’, via: ‘delete’
I am able to sign in, but I can’t sign out. The problem is that there are not any log error and I don’t know what to do.
Any ideas?
Thanks!