Class: Admin::LinkGroupsController

Inherits:
AdminController
  • Object
show all
Defined in:
app/controllers/admin/link_groups_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'app/controllers/admin/link_groups_controller.rb', line 21

def create
  respond_to do |format|
    format.html do
      @link_group = LinkGroup.new post_params[:link_group]

      if @link_group.save
        redirect_to admin_link_groups_url, notice: t(:successfully_added)
      else
        render action: 'new'
      end
    end
  end
end

#destroyObject



47
48
49
50
51
52
53
54
# File 'app/controllers/admin/link_groups_controller.rb', line 47

def destroy
  respond_to do |format|
    format.html do
      @link_group.destroy
      redirect_to admin_link_groups_url, notice: t(:successfully_deleted)
    end
  end
end

#editObject



17
18
19
# File 'app/controllers/admin/link_groups_controller.rb', line 17

def edit
  respond_with @link_group
end

#indexObject



8
9
10
# File 'app/controllers/admin/link_groups_controller.rb', line 8

def index
  respond_with @link_groups
end

#newObject



12
13
14
15
# File 'app/controllers/admin/link_groups_controller.rb', line 12

def new
  @link_group = LinkGroup.new
  respond_with @link_group
end

#updateObject



35
36
37
38
39
40
41
42
43
44
45
# File 'app/controllers/admin/link_groups_controller.rb', line 35

def update
  respond_to do |format|
    format.html do
      if @link_group.update_attributes post_params[:link_group]
        redirect_to admin_link_groups_path, notice: t(:successfully_updated)
      else
        rener action: 'edit'
      end
    end
  end
end