Class: Gamification::ItemGroupsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/gamification/item_groups_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject

POST /gamification/item_groups



24
25
26
27
28
29
30
31
32
33
34
# File 'app/controllers/gamification/item_groups_controller.rb', line 24

def create
  authorize! :create, @gamification_item_group

  @gamification_item_group = Gamification::ItemGroup.new(gamification_item_group_params)

  if @gamification_item_group.save
    redirect_to @gamification_item_group, notice: 'Item group was successfully created.'
  else
    render :new
  end
end

#destroyObject

DELETE /gamification/item_groups/1



46
47
48
49
# File 'app/controllers/gamification/item_groups_controller.rb', line 46

def destroy
  @gamification_item_group.destroy
  redirect_to gamification_item_groups_url, notice: 'Item group was successfully destroyed.'
end

#editObject

GET /gamification/item_groups/1/edit



20
21
# File 'app/controllers/gamification/item_groups_controller.rb', line 20

def edit
end

#indexObject

GET /gamification/item_groups



6
7
8
# File 'app/controllers/gamification/item_groups_controller.rb', line 6

def index
  @gamification_item_groups = Gamification::ItemGroup.all
end

#newObject

GET /gamification/item_groups/new



15
16
17
# File 'app/controllers/gamification/item_groups_controller.rb', line 15

def new
  @gamification_item_group = Gamification::ItemGroup.new
end

#showObject

GET /gamification/item_groups/1



11
12
# File 'app/controllers/gamification/item_groups_controller.rb', line 11

def show
end

#updateObject

PATCH/PUT /gamification/item_groups/1



37
38
39
40
41
42
43
# File 'app/controllers/gamification/item_groups_controller.rb', line 37

def update
  if @gamification_item_group.update(gamification_item_group_params)
    redirect_to @gamification_item_group, notice: 'Item group was successfully updated.'
  else
    render :edit
  end
end