Sha256: 53a6c01f0d2e47c81310917b24fb980722ec70e0160e9368d324c1d020ee91d0

Contents?: true

Size: 1.08 KB

Versions: 96

Compression:

Stored size: 1.08 KB

Contents

class Wco::OfficeActionsController < Wco::ApplicationController

  before_action :set_lists

  def create
    @oa = OA.new params[:oa].permit!
    authorize! :update, @oa

    if @oa.save
      flash_notice @oa
    else
      flash_alert @oa
    end
    redirect_to action: :index
  end

  def edit
    @oa = OA.find params[:id]
    authorize! :edit, @oa
  end

  def index
    authorize! :index, OA
    @oas = OA.all
  end

  def new
    @oa = OA.new
    authorize! :new, @oa
  end

  def show
    @oa = OA.find params[:id]
    authorize! :show, @oa
  end

  def update
    @oa = OA.find params[:id]
    authorize! :update, @oa

    if @oa.update params[:oa].permit!
      flash_notice @oa
    else
      flash_alert @oa
    end
    redirect_to action: :index
  end

  ##
  ## private
  ##
  private

  def set_lists
    @from_types_list = [ nil, 'Wco::Gallery', 'Wco::Tag' ]
    @from_type = params[:from_type]
    @from_ids_list = []
    if @from_type.present?
      @from_ids_list = @from_type.constantize.list
    end
    @publishers_list = Wco::Publisher.list

    @oats_list = OAT.list
  end


end

Version data entries

96 entries across 96 versions & 1 rubygems

Version Path
wco_models-3.1.0.189 app/controllers/wco/office_actions_controller.rb
wco_models-3.1.0.188 app/controllers/wco/office_actions_controller.rb
wco_models-3.1.0.187 app/controllers/wco/office_actions_controller.rb
wco_models-3.1.0.184 app/controllers/wco/office_actions_controller.rb
wco_models-3.1.0.183 app/controllers/wco/office_actions_controller.rb
wco_models-3.1.0.182 app/controllers/wco/office_actions_controller.rb
wco_models-3.1.0.181 app/controllers/wco/office_actions_controller.rb
wco_models-3.1.0.180 app/controllers/wco/office_actions_controller.rb
wco_models-3.1.0.178 app/controllers/wco/office_actions_controller.rb
wco_models-3.1.0.177 app/controllers/wco/office_actions_controller.rb
wco_models-3.1.0.176 app/controllers/wco/office_actions_controller.rb
wco_models-3.1.0.175 app/controllers/wco/office_actions_controller.rb
wco_models-3.1.0.174 app/controllers/wco/office_actions_controller.rb
wco_models-3.1.0.173 app/controllers/wco/office_actions_controller.rb
wco_models-3.1.0.172 app/controllers/wco/office_actions_controller.rb
wco_models-3.1.0.171 app/controllers/wco/office_actions_controller.rb
wco_models-3.1.0.170 app/controllers/wco/office_actions_controller.rb
wco_models-3.1.0.169 app/controllers/wco/office_actions_controller.rb
wco_models-3.1.0.168 app/controllers/wco/office_actions_controller.rb
wco_models-3.1.0.167 app/controllers/wco/office_actions_controller.rb