Class: Renalware::Modalities::ModalitiesController
- Inherits:
-
BaseController
- Object
- ApplicationController
- ApplicationController
- BaseController
- Renalware::Modalities::ModalitiesController
- Defined in:
- app/controllers/renalware/modalities/modalities_controller.rb
Instance Method Summary collapse
Methods inherited from BaseController
Instance Method Details
#create ⇒ Object
23 24 25 26 27 28 29 30 31 |
# File 'app/controllers/renalware/modalities/modalities_controller.rb', line 23 def create result = change_patient_modality if result.success? handle_valid_modality else flash.now[:error] = t(".failed", model_name: "modality") render :new, locals: { patient: patient, modality: result.object } end end |
#index ⇒ Object
15 16 17 18 19 20 21 |
# File 'app/controllers/renalware/modalities/modalities_controller.rb', line 15 def index modalities = patient .modalities .includes([:description, :created_by]) .ordered render locals: { patient: patient, modalities: modalities } end |
#new ⇒ Object
10 11 12 13 |
# File 'app/controllers/renalware/modalities/modalities_controller.rb', line 10 def new modality = Modality.new(patient: patient) render locals: { patient: patient, modality: modality } end |