Skip to content

Instantly share code, notes, and snippets.

@dimroc
Created September 17, 2015 18:24
Show Gist options
  • Select an option

  • Save dimroc/6e698f7edf3388cd016c to your computer and use it in GitHub Desktop.

Select an option

Save dimroc/6e698f7edf3388cd016c to your computer and use it in GitHub Desktop.
class Admin::ImpersonationsController < AdminController
respond_to :html
def update
current_user.update_attributes(impersonating_params)
respond_with current_user, location: admin_organizations_path
end
def destroy
current_user.update_attributes(impersonating_id: nil)
respond_with current_user, location: admin_users_path
end
private
def impersonating_params
params[:user].permit(:impersonating_id)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment