Class: Renalware::Problems::NotesController

Inherits:
BaseController show all
Defined in:
app/controllers/renalware/problems/notes_controller.rb

Instance Method Summary collapse

Methods inherited from BaseController

#patient

Instance Method Details

#createObject



19
20
21
22
23
24
25
26
27
28
# File 'app/controllers/renalware/problems/notes_controller.rb', line 19

def create
  load_problem
  note = @problem.notes.create(notes_params)

  if note.save
    render_index
  else
    render_form(note, url: patient_problem_notes_path(patient, @problem))
  end
end

#indexObject



8
9
10
11
# File 'app/controllers/renalware/problems/notes_controller.rb', line 8

def index
  load_problem
  render_index
end

#newObject



13
14
15
16
17
# File 'app/controllers/renalware/problems/notes_controller.rb', line 13

def new
  load_problem
  note = @problem.notes.new
  render_form(note, url: patient_problem_notes_path(patient, @problem))
end