Class: ThinkFeelDoDashboard::UsersController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- ThinkFeelDoDashboard::UsersController
- Defined in:
- app/controllers/think_feel_do_dashboard/users_controller.rb
Overview
Allows for the creation, updating, and deletion of users
Instance Method Summary collapse
-
#create ⇒ Object
POST /think_feel_do_dashboard/users.
-
#destroy ⇒ Object
DELETE /think_feel_do_dashboard/users/1.
-
#edit ⇒ Object
GET /think_feel_do_dashboard/users/1/edit.
-
#index ⇒ Object
GET /think_feel_do_dashboard/users.
-
#new ⇒ Object
GET /think_feel_do_dashboard/users/new.
-
#show ⇒ Object
GET /think_feel_do_dashboard/users/1.
-
#update ⇒ Object
PATCH/PUT /think_feel_do_dashboard/users/1.
Instance Method Details
#create ⇒ Object
POST /think_feel_do_dashboard/users
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'app/controllers/think_feel_do_dashboard/users_controller.rb', line 18 def create @user = User.new(user_params.except(:user_roles)) :create, @user build_user_roles(params) if @user.save redirect_to @user, notice: "User was successfully created." else render :new end end |
#destroy ⇒ Object
DELETE /think_feel_do_dashboard/users/1
53 54 55 56 57 |
# File 'app/controllers/think_feel_do_dashboard/users_controller.rb', line 53 def destroy @user.destroy redirect_to users_url, notice: "User was successfully destroyed." end |
#edit ⇒ Object
GET /think_feel_do_dashboard/users/1/edit
36 37 |
# File 'app/controllers/think_feel_do_dashboard/users_controller.rb', line 36 def edit end |
#index ⇒ Object
GET /think_feel_do_dashboard/users
10 11 |
# File 'app/controllers/think_feel_do_dashboard/users_controller.rb', line 10 def index end |
#new ⇒ Object
GET /think_feel_do_dashboard/users/new
14 15 |
# File 'app/controllers/think_feel_do_dashboard/users_controller.rb', line 14 def new end |
#show ⇒ Object
GET /think_feel_do_dashboard/users/1
32 33 |
# File 'app/controllers/think_feel_do_dashboard/users_controller.rb', line 32 def show end |
#update ⇒ Object
PATCH/PUT /think_feel_do_dashboard/users/1
40 41 42 43 44 45 46 47 48 49 50 |
# File 'app/controllers/think_feel_do_dashboard/users_controller.rb', line 40 def update build_user_roles(params) if @user.update(user_params.except(:user_roles)) sign_in @user, bypass: true if @user == current_user redirect_to user_path(@user), notice: "User was successfully updated.", only: true else render :edit end end |