Skip to content

Instantly share code, notes, and snippets.

@ValeriiVasin
Forked from aslam/application.rb
Created January 14, 2012 17:35
Show Gist options
  • Save ValeriiVasin/1612209 to your computer and use it in GitHub Desktop.
Save ValeriiVasin/1612209 to your computer and use it in GitHub Desktop.
Rails 3 reset session using devise (actually not using devise)
class ApplicationController < ActionController::Base
...
before_filter :save_or_clear_session
def save_or_clear_session
if controller_name.eql?('sessions') and action_name.eql?('destroy')
request.reset_session
flash[:notice] = "Signed out successfully."
end
end
...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment