Class: Admin::GroupsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/admin/groups_controller.rb

Overview

Copyright © 2008-2013 Michael Dvorkin and contributors.

Fat Free CRM is freely distributable under the terms of MIT license. See MIT-LICENSE file or www.opensource.org/licenses/mit-license.php


Instance Method Summary collapse

Instance Method Details

#createObject

POST /groups




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

def create
  @group.attributes = group_params
  @group.save

  respond_with(@group)
end

#destroyObject

DELETE /groups/1




54
55
56
57
58
# File 'app/controllers/admin/groups_controller.rb', line 54

def destroy
  @group.destroy

  respond_with(@group)
end

#editObject

GET /groups/1/edit




31
32
33
# File 'app/controllers/admin/groups_controller.rb', line 31

def edit
  respond_with(@group)
end

#indexObject

GET /groups




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

def index
  @groups = @groups.unscoped.paginate(page: params[:page])
end

#newObject

GET /groups/new




25
26
27
# File 'app/controllers/admin/groups_controller.rb', line 25

def new
  respond_with(@group)
end

#showObject

GET /groups/1




19
20
21
# File 'app/controllers/admin/groups_controller.rb', line 19

def show
  respond_with(@group)
end

#updateObject

PUT /groups/1




46
47
48
49
50
# File 'app/controllers/admin/groups_controller.rb', line 46

def update
  @group.update_attributes(group_params)

  respond_with(@group)
end