Friday, July 5, 2013

[Rails] Sign in and sign out

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!

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/7e2a0b3d-675e-4e35-8d24-ee5a0ea683c3%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate