Class: Renalware::HD::CannulationTypesController
- Inherits:
-
BaseController
- Object
- ApplicationController
- ApplicationController
- BaseController
- BaseController
- Renalware::HD::CannulationTypesController
- Defined in:
- app/controllers/renalware/hd/cannulation_types_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/hd/cannulation_types_controller.rb', line 14 def create cannulation_type = CannulationType.new(cannulation_type_params) cannulation_type if cannulation_type.save redirect_to hd_cannulation_types_path, notice: t(".success", model_name: "cannulation type") else flash.now[:error] = t(".failed", model_name: "cannulation type") render_new(cannulation_type) end end |
#destroy ⇒ Object
49 50 51 52 53 |
# File 'app/controllers/renalware/hd/cannulation_types_controller.rb', line 49 def destroy CannulationType.destroy(params[:id]) redirect_to hd_cannulation_types_path, notice: t(".success", model_name: "cannulation type") end |
#edit ⇒ Object
33 34 35 36 |
# File 'app/controllers/renalware/hd/cannulation_types_controller.rb', line 33 def edit cannulation_type = render_edit(cannulation_type) end |
#index ⇒ Object
27 28 29 30 31 |
# File 'app/controllers/renalware/hd/cannulation_types_controller.rb', line 27 def index cannulation_types = CannulationType.all cannulation_types render locals: { cannulation_types: cannulation_types } end |
#new ⇒ Object
8 9 10 11 12 |
# File 'app/controllers/renalware/hd/cannulation_types_controller.rb', line 8 def new cannulation_type = CannulationType.new cannulation_type render_new(cannulation_type) end |
#update ⇒ Object
38 39 40 41 42 43 44 45 46 47 |
# File 'app/controllers/renalware/hd/cannulation_types_controller.rb', line 38 def update cannulation_type = if cannulation_type.update(cannulation_type_params) redirect_to hd_cannulation_types_path, notice: t(".success", model_name: "cannulation type") else flash.now[:error] = t(".failed", model_name: "cannulation type") render_edit(cannulation_type) end end |