Class: GroupsController
- Inherits:
-
AdminController
- Object
- AdminController
- GroupsController
- Defined in:
- app/controllers/groups_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
post /groups.
-
#destroy ⇒ Object
delete /groups/:id.
-
#edit ⇒ Object
get /groups/:id/edit.
-
#new ⇒ Object
get /groups/new.
-
#update ⇒ Object
patch /groups/:id.
Instance Method Details
#create ⇒ Object
post /groups
11 12 13 14 15 16 17 18 |
# File 'app/controllers/groups_controller.rb', line 11 def create @entity = Group.new(entity_parameters) if @entity.save redirect_to(admin_group_path(id: @entity.id)) else render :new, status: :bad_request end end |
#destroy ⇒ Object
delete /groups/:id
34 35 36 37 38 39 |
# File 'app/controllers/groups_controller.rb', line 34 def destroy if @entity.destroy flash[:notice] = t('groups.destroy.success') end redirect_to admin_groups_path end |
#edit ⇒ Object
get /groups/:id/edit
21 22 |
# File 'app/controllers/groups_controller.rb', line 21 def edit end |
#new ⇒ Object
get /groups/new
6 7 8 |
# File 'app/controllers/groups_controller.rb', line 6 def new @entity = Group.new end |
#update ⇒ Object
patch /groups/:id
25 26 27 28 29 30 31 |
# File 'app/controllers/groups_controller.rb', line 25 def update if @entity.update(entity_parameters) redirect_to admin_group_path(id: @entity.id), notice: t('groups.update.success') else render :edit, status: :bad_request end end |