Class: Gluttonberg::Admin::Membership::GroupsController

Inherits:
BaseController show all
Defined in:
app/controllers/gluttonberg/admin/membership/groups_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



20
21
22
23
24
25
26
# File 'app/controllers/gluttonberg/admin/membership/groups_controller.rb', line 20

def create
  @group = Group.new(params[:gluttonberg_group])
  generic_create(@group, {
    :name => "group",
    :success_path => admin_membership_groups_path
  })
end

#deleteObject



39
40
41
42
43
44
45
# File 'app/controllers/gluttonberg/admin/membership/groups_controller.rb', line 39

def delete
  display_delete_confirmation(
    :title      => "Delete “#{@group.name}” group?",
    :url        => admin_membership_group_path(@group),
    :return_url => admin_membership_groups_path
  )
end

#destroyObject



47
48
49
50
51
52
53
# File 'app/controllers/gluttonberg/admin/membership/groups_controller.rb', line 47

def destroy
  generic_destroy(@group, {
    :name => "group",
    :success_path => admin_groups_path,
    :failure_path => admin_groups_path
  })
end

#editObject



28
29
# File 'app/controllers/gluttonberg/admin/membership/groups_controller.rb', line 28

def edit
end

#indexObject



12
13
14
# File 'app/controllers/gluttonberg/admin/membership/groups_controller.rb', line 12

def index
  @groups = Group.all
end

#newObject



16
17
18
# File 'app/controllers/gluttonberg/admin/membership/groups_controller.rb', line 16

def new
  @group = Group.new
end

#updateObject



31
32
33
34
35
36
37
# File 'app/controllers/gluttonberg/admin/membership/groups_controller.rb', line 31

def update
  @group.assign_attributes(params[:gluttonberg_group])
  generic_update(@group, {
    :name => "group",
    :success_path => admin_membership_groups_path
  })
end