Sha256: 4b6c5bf474d1e55dcebf28623c661a91cd2eabe0bf6109f61946b3c045fc1083
Contents?: true
Size: 1.59 KB
Versions: 1
Compression:
Stored size: 1.59 KB
Contents
require_dependency "renalware/hd/base_controller" module Renalware module HD class CannulationTypesController < BaseController before_action :load_cannulation_type, only: [:edit, :update] def new @cannulation_type = CannulationType.new authorize @cannulation_type end def create @cannulation_type = CannulationType.new(cannulation_type_params) authorize @cannulation_type if @cannulation_type.save redirect_to hd_cannulation_types_path, notice: t(".success", model_name: "cannulation type") else flash[:error] = t(".failed", model_name: "cannulation type") render :new end end def index @cannulation_types = CannulationType.all authorize @cannulation_types end def update if @cannulation_type.update(cannulation_type_params) redirect_to hd_cannulation_types_path, notice: t(".success", model_name: "cannulation type") else flash[:error] = t(".failed", model_name: "cannulation type") render :edit end end def destroy authorize CannulationType.destroy(params[:id]) redirect_to hd_cannulation_types_path, notice: t(".success", model_name: "cannulation type") end private def cannulation_type_params params.require(:hd_cannulation_type).permit(:name) end def load_cannulation_type @cannulation_type = CannulationType.find(params[:id]) authorize @cannulation_type end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
renalware-core-2.0.0.pre.beta4 | app/controllers/renalware/hd/cannulation_types_controller.rb |