Class: Renalware::Pathology::CodeGroupsController

Inherits:
BaseController show all
Defined in:
app/controllers/renalware/pathology/code_groups_controller.rb

Instance Method Summary collapse

Methods inherited from BaseController

#patient

Instance Method Details

#editObject



18
19
20
# File 'app/controllers/renalware/pathology/code_groups_controller.rb', line 18

def edit
  render locals: { group: find_authorize_group }
end

#indexObject



8
9
10
11
12
# File 'app/controllers/renalware/pathology/code_groups_controller.rb', line 8

def index
  groups = CodeGroup.order(:name)
  authorize groups, :index?
  render locals: { groups: groups }
end

#showObject



14
15
16
# File 'app/controllers/renalware/pathology/code_groups_controller.rb', line 14

def show
  render locals: { group: find_authorize_group }
end

#updateObject



22
23
24
25
26
27
28
29
# File 'app/controllers/renalware/pathology/code_groups_controller.rb', line 22

def update
  group = find_authorize_group
  if group.update_by(current_user, code_group_params)
    redirect_to pathology_code_groups_path, notice: "Group saved"
  else
    render :edit, locals: { group: group }
  end
end