Class: Renalware::Modalities::DescriptionsController
- Inherits:
-
BaseController
- Object
- ApplicationController
- ApplicationController
- BaseController
- Renalware::Modalities::DescriptionsController
- Defined in:
- app/controllers/renalware/modalities/descriptions_controller.rb
Instance Method Summary collapse
Methods inherited from BaseController
Instance Method Details
#create ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'app/controllers/renalware/modalities/descriptions_controller.rb', line 14 def create modality_description = Description.new(modality_description_params) modality_description if modality_description.save redirect_to modalities_descriptions_path, notice: t(".success", model_name: "modality description") else flash.now[:error] = t(".failed", model_name: "modality description") render_new(modality_description) end end |
#destroy ⇒ Object
48 49 50 51 52 |
# File 'app/controllers/renalware/modalities/descriptions_controller.rb', line 48 def destroy Description.destroy(params[:id]) redirect_to modalities_descriptions_path, notice: t(".success", model_name: "modality description") end |
#edit ⇒ Object
33 34 35 |
# File 'app/controllers/renalware/modalities/descriptions_controller.rb', line 33 def edit render_edit() end |
#index ⇒ Object
27 28 29 30 31 |
# File 'app/controllers/renalware/modalities/descriptions_controller.rb', line 27 def index modality_descriptions = Description.all modality_descriptions render locals: { modality_descriptions: modality_descriptions } end |
#new ⇒ Object
8 9 10 11 12 |
# File 'app/controllers/renalware/modalities/descriptions_controller.rb', line 8 def new modality_description = Description.new modality_description render_new(modality_description) end |
#update ⇒ Object
37 38 39 40 41 42 43 44 45 46 |
# File 'app/controllers/renalware/modalities/descriptions_controller.rb', line 37 def update modality_description = if modality_description.update(modality_description_params) redirect_to modalities_descriptions_path, notice: t(".success", model_name: "modality description") else flash.now[:error] = t(".failed", model_name: "modality description") render_edit(modality_description) end end |