Class: Admin::UserGroupsController
- Inherits:
-
ForestController
- Object
- ForestController
- Admin::UserGroupsController
- Includes:
- FilterControllerScopes
- Defined in:
- app/controllers/admin/user_groups_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /user_groups.
-
#destroy ⇒ Object
DELETE /user_groups/1.
-
#edit ⇒ Object
GET /user_groups/1/edit.
-
#index ⇒ Object
GET /user_groups.
-
#new ⇒ Object
GET /user_groups/new.
-
#show ⇒ Object
GET /user_groups/1.
-
#update ⇒ Object
PATCH/PUT /user_groups/1.
Instance Method Details
#create ⇒ Object
POST /user_groups
31 32 33 34 35 36 37 38 39 40 |
# File 'app/controllers/admin/user_groups_controller.rb', line 31 def create @user_group = UserGroup.new(user_group_params) @user_group if @user_group.save redirect_to edit_admin_user_group_path(@user_group), notice: 'User group was successfully created.' else render :new end end |
#destroy ⇒ Object
DELETE /user_groups/1
53 54 55 56 57 |
# File 'app/controllers/admin/user_groups_controller.rb', line 53 def destroy @user_group @user_group.destroy redirect_to admin_user_groups_url, notice: 'User group was successfully destroyed.' end |
#edit ⇒ Object
GET /user_groups/1/edit
26 27 28 |
# File 'app/controllers/admin/user_groups_controller.rb', line 26 def edit @user_group end |
#index ⇒ Object
GET /user_groups
9 10 11 12 |
# File 'app/controllers/admin/user_groups_controller.rb', line 9 def index @user_groups = apply_scopes(UserGroup).by_name.page params[:page] @user_groups end |
#new ⇒ Object
GET /user_groups/new
20 21 22 23 |
# File 'app/controllers/admin/user_groups_controller.rb', line 20 def new @user_group = UserGroup.new @user_group end |
#show ⇒ Object
GET /user_groups/1
15 16 17 |
# File 'app/controllers/admin/user_groups_controller.rb', line 15 def show @user_group end |
#update ⇒ Object
PATCH/PUT /user_groups/1
43 44 45 46 47 48 49 50 |
# File 'app/controllers/admin/user_groups_controller.rb', line 43 def update @user_group if @user_group.update(user_group_params) redirect_to edit_admin_user_group_path(@user_group), notice: 'User group was successfully updated.' else render :edit end end |