devise - Rails: Switch User Gem and issues with switching back to original user -
in app using switch_user ( https://github.com/flyerhzm/switch_user ) gem allow admins login user. gem has ability log in admin, having hard time conceptualizing how it. here config: switchuser.setup |config| # provider may :devise, :authlogic, :clearance, :restful_authentication, :sorcery, or :session config.provider = :devise # available_users hash, # key model name of user (:user, :admin, or name use), # value block return users can switched. config.available_users = { :user => lambda { user.all } } # available_users_identifiers hash, # keys in hash should match key in available_users hash # value name of identifying column find by, # defaults id # hash allow specify different column # expose instance username on user model instead of id config.available_users_identifiers = { :user => :id } # available_users_names hash, # keys in hash should match key in available_users hash # value column name displayed in select box config.availab