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




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

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

  respond_with(@group)
end

#destroyObject

DELETE /groups/1




56
57
58
59
60
# File 'app/controllers/admin/groups_controller.rb', line 56

def destroy
  @group.destroy

  respond_with(@group)
end

#editObject

GET /groups/1/edit




33
34
35
# File 'app/controllers/admin/groups_controller.rb', line 33

def edit
  respond_with(@group)
end

#indexObject

GET /groups




15
16
17
# File 'app/controllers/admin/groups_controller.rb', line 15

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

#newObject

GET /groups/new




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

def new
  respond_with(@group)
end

#showObject

GET /groups/1




21
22
23
# File 'app/controllers/admin/groups_controller.rb', line 21

def show
  respond_with(@group)
end

#updateObject

PUT /groups/1




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

def update
  @group.update_attributes(group_params)

  respond_with(@group)
end