Class: Incline::AccessGroupsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/incline/access_groups_controller.rb

Instance Method Summary collapse

Instance Method Details

#apiObject

GET/POST /incline/access_groups/api?action=…



70
71
72
# File 'app/controllers/incline/access_groups_controller.rb', line 70

def api
  process_api_action
end

#createObject

POST /incline/access_groups



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

def create
  @access_group = Incline::AccessGroup.create(access_group_params :before_create)
  if @access_group
    if @access_group.update(access_group_params :after_create)
      handle_update_success notice: 'Access group was successfully created.'
    else
      handle_update_failure :new
    end
  else
    handle_update_failure :new
  end
end

#destroyObject

DELETE /incline/access_groups/1



59
60
61
62
# File 'app/controllers/incline/access_groups_controller.rb', line 59

def destroy
  @access_group.destroy
  handle_update_success notice: 'Access group was successfully destroyed.'
end

#editObject

GET /incline/access_groups/1/edit



29
30
# File 'app/controllers/incline/access_groups_controller.rb', line 29

def edit
end

#indexObject

GET /incline/access_groups



13
14
# File 'app/controllers/incline/access_groups_controller.rb', line 13

def index
end

#locateObject

POST /incline/access_groups/1/locate



65
66
67
# File 'app/controllers/incline/access_groups_controller.rb', line 65

def locate
  render json: { record: @dt_request.record_location }
end

#newObject

GET /incline/access_groups/new



23
24
25
# File 'app/controllers/incline/access_groups_controller.rb', line 23

def new
  @access_group = Incline::AccessGroup.new
end

#showObject

GET /incline/access_groups/1



18
19
# File 'app/controllers/incline/access_groups_controller.rb', line 18

def show
end

#updateObject

PATCH/PUT /incline/access_groups/1



49
50
51
52
53
54
55
# File 'app/controllers/incline/access_groups_controller.rb', line 49

def update
  if @access_group.update(access_group_params)
    handle_update_success notice: 'Access group was successfully updated.'
  else
    handle_update_failure :edit
  end
end