Sha256: 0419c20695e88c1593cf20a64d397a055da09e021ec59db9fd7ddf5840ea8144
Contents?: true
Size: 737 Bytes
Versions: 42
Compression:
Stored size: 737 Bytes
Contents
class ::IshManager::ApplianceTmplsController < IshManager::ApplicationController before_action :set_lists def create @appliance_tmpl = Wco::ApplianceTmpl.new params[:appliance].permit! authorize! :create, @appliance_tmpl flag = @appliance_tmpl.save if flag flash[:notice] = 'Success.' redirect_to action: :index else flash[:alert] = "Cannot create appliance tmplate: #{@appliance_tmpl.errors.full_messages.join(', ')}." render action: :index end end def index authorize! :index, Wco::ApplianceTmpl @appliance_tmpls = Wco::ApplianceTmpl.all end ## ## private ## private def set_lists super @new_appliance_tmpl = Wco::ApplianceTmpl.new end end
Version data entries
42 entries across 42 versions & 1 rubygems