Class: Renalware::PD::ExitSiteInfectionsController
- Inherits:
-
BaseController
- Object
- ApplicationController
- ApplicationController
- BaseController
- BaseController
- Renalware::PD::ExitSiteInfectionsController
- Includes:
- PresenterHelper, Concerns::PdfRenderable
- Defined in:
- app/controllers/renalware/pd/exit_site_infections_controller.rb
Instance Method Summary collapse
Methods included from PresenterHelper
Methods inherited from BaseController
Instance Method Details
#create ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 |
# File 'app/controllers/renalware/pd/exit_site_infections_controller.rb', line 26 def create esi = ExitSiteInfection.new(exit_site_infection_params.merge!(patient_id: patient.id)) esi if esi.save redirect_to patient_pd_exit_site_infection_path(patient, esi), notice: t(".success", model_name: "exit site infection") else flash.now[:error] = t(".failed", model_name: "exit site infection") render_new(esi) end end |
#edit ⇒ Object
38 39 40 41 |
# File 'app/controllers/renalware/pd/exit_site_infections_controller.rb', line 38 def edit exit_site_infection render locals: locals end |
#new ⇒ Object
20 21 22 23 24 |
# File 'app/controllers/renalware/pd/exit_site_infections_controller.rb', line 20 def new esi = ExitSiteInfection.new esi render_new(esi) end |
#show ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'app/controllers/renalware/pd/exit_site_infections_controller.rb', line 11 def show exit_site_infection respond_to do |format| format.html { render_show } format.js { render_show } format.pdf { render_esi_as_pdf_printout } end end |
#update ⇒ Object
43 44 45 46 47 48 49 50 51 52 |
# File 'app/controllers/renalware/pd/exit_site_infections_controller.rb', line 43 def update exit_site_infection if exit_site_infection.update(exit_site_infection_params) redirect_to patient_pd_exit_site_infection_path(patient, exit_site_infection), notice: t(".success", model_name: "exit site infection") else flash.now[:error] = t(".failed", model_name: "exit site infection") render_edit end end |