Class: Renalware::Pathology::ObservationDescriptionsController
- Inherits:
-
BaseController
- Object
- ApplicationController
- ApplicationController
- BaseController
- BaseController
- Renalware::Pathology::ObservationDescriptionsController
- Includes:
- Pagy::Backend
- Defined in:
- app/controllers/renalware/pathology/observation_descriptions_controller.rb
Instance Method Summary collapse
Methods inherited from BaseController
Instance Method Details
#edit ⇒ Object
20 21 22 |
# File 'app/controllers/renalware/pathology/observation_descriptions_controller.rb', line 20 def edit render_edit end |
#index ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'app/controllers/renalware/pathology/observation_descriptions_controller.rb', line 10 def index query = ObservationDescription .includes(:measurement_unit) .order(:code) .ransack(params[:q] || {}) pagy, descriptions = pagy(query.result) descriptions render locals: { descriptions: descriptions, pagy: pagy, query: query } end |
#update ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 |
# File 'app/controllers/renalware/pathology/observation_descriptions_controller.rb', line 24 def update description = if description.update(description_params) redirect_to( pathology_observation_descriptions_path, notice: t(".success", model_name: "observation descrition") ) else render_edit(description) end end |