Class: Renalware::Problems::NotesController
- Inherits:
-
BaseController
- Object
- ApplicationController
- ApplicationController
- BaseController
- Renalware::Problems::NotesController
- Defined in:
- app/controllers/renalware/problems/notes_controller.rb
Instance Method Summary collapse
Methods inherited from BaseController
Instance Method Details
#create ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'app/controllers/renalware/problems/notes_controller.rb', line 19 def create note = problem.notes.create(notes_params) (note) if note.save render_index else render_form( note, url: patient_problem_notes_path(patient, problem) ) end end |
#destroy ⇒ Object
52 53 54 55 56 |
# File 'app/controllers/renalware/problems/notes_controller.rb', line 52 def destroy note note.destroy! render_index end |
#edit ⇒ Object
32 33 34 35 36 37 38 |
# File 'app/controllers/renalware/problems/notes_controller.rb', line 32 def edit note render_form( note, url: patient_problem_note_path(patient, problem, note) ) end |
#index ⇒ Object
6 7 8 |
# File 'app/controllers/renalware/problems/notes_controller.rb', line 6 def index render_index end |
#new ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'app/controllers/renalware/problems/notes_controller.rb', line 10 def new note = problem.notes.new (note) render_form( note, url: patient_problem_notes_path(patient, problem) ) end |
#update ⇒ Object
40 41 42 43 44 45 46 47 48 49 50 |
# File 'app/controllers/renalware/problems/notes_controller.rb', line 40 def update note if note.update_by(current_user, notes_params) render_index else render_form( note, url: patient_problem_notes_path(patient, problem) ) end end |