Class: Admin::UsersController
- Inherits:
-
AdminController
- Object
- AdminController
- Admin::UsersController
- Defined in:
- app/controllers/admin/users_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
-
#delete ⇒ Object
DELETE /accounts/1.
-
#edit ⇒ Object
GET /accounts/1/edit.
- #index ⇒ Object
-
#new ⇒ Object
GET /accounts/new.
-
#show ⇒ Object
GET /accounts/1.
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
13 14 |
# File 'app/controllers/admin/users_controller.rb', line 13 def create end |
#delete ⇒ Object
DELETE /accounts/1
39 40 41 42 |
# File 'app/controllers/admin/users_controller.rb', line 39 def delete ApiToken.find_by(token: params[:id]).destroy redirect_back(fallback_location: root_path) end |
#edit ⇒ Object
GET /accounts/1/edit
35 36 |
# File 'app/controllers/admin/users_controller.rb', line 35 def edit end |
#index ⇒ Object
4 5 6 |
# File 'app/controllers/admin/users_controller.rb', line 4 def index @users = User.all end |
#new ⇒ Object
GET /accounts/new
30 31 32 |
# File 'app/controllers/admin/users_controller.rb', line 30 def new @user = User.new end |
#show ⇒ Object
GET /accounts/1
9 10 11 |
# File 'app/controllers/admin/users_controller.rb', line 9 def show @tokens = @user.api_tokens end |
#update ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'app/controllers/admin/users_controller.rb', line 16 def update @user = User.find(params[:user][:id]) email = @user.email @user.update(email_params) if email != params[:user][:unconfirmed_email] @user.confirmation_sent_at = Time.now @user.save @user.send_confirmation_instructions # flash[:notice] = I18n.t("revise_auth.confirmation_email_sent", email: current_user.unconfirmed_email) end redirect_back(fallback_location: root_path) end |