Class: Gaku::Admin::BadgeTypesController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/gaku/admin/badge_types_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



19
20
21
22
23
24
25
26
27
# File 'app/controllers/gaku/admin/badge_types_controller.rb', line 19

def create
  @badge_type = BadgeType.new(badge_type_params)
  if @badge_type.save
    set_count
    respond_with @badge_type
  else
    render :new
  end
end

#destroyObject



37
38
39
40
41
# File 'app/controllers/gaku/admin/badge_types_controller.rb', line 37

def destroy
  @badge_type.destroy
  set_count
  respond_with @badge_type
end

#editObject



29
30
# File 'app/controllers/gaku/admin/badge_types_controller.rb', line 29

def edit
end

#indexObject



8
9
10
11
12
# File 'app/controllers/gaku/admin/badge_types_controller.rb', line 8

def index
  @badge_types = BadgeType.all
  set_count
  respond_with @badge_types
end

#newObject



14
15
16
17
# File 'app/controllers/gaku/admin/badge_types_controller.rb', line 14

def new
  @badge_type = BadgeType.new
  respond_with @badge_type
end

#updateObject



32
33
34
35
# File 'app/controllers/gaku/admin/badge_types_controller.rb', line 32

def update
  @badge_type.update(badge_type_params)
  respond_with @badge_type
end