Sign in and sign out

16 views
Skip to first unread message

Javier Molina

unread,
Jul 5, 2013, 11:19:11 AM7/5/13
to rubyonra...@googlegroups.com
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!

Reply all
Reply to author
Forward
0 new messages