Class: TokenAuthenticationsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- TokenAuthenticationsController
- Defined in:
- app/controllers/token_authentications_controller.rb
Overview
token_authentications_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
5 6 7 8 9 10 |
# File 'app/controllers/token_authentications_controller.rb', line 5 def create #@user = User.criteria.id(params[:user_id]).first @user = User.find(params[:user_id]) @user.reset_authentication_token! redirect_to edit_user_registration_path(@user) end |
#destroy ⇒ Object
12 13 14 15 16 17 18 |
# File 'app/controllers/token_authentications_controller.rb', line 12 def destroy #@user = User.criteria.id(params[:id]).first @user = User.find(params[:id]) @user.authentication_token = nil @user.save redirect_to edit_user_registration_path(@user) end |