Sha256: 17ce959afa23c3e77d674436ad60edfbcb0f464a084fbdca55eb639a68ba5a34

Contents?: true

Size: 1.14 KB

Versions: 152

Compression:

Stored size: 1.14 KB

Contents

class Wco::LogsController < Wco::ApplicationController

  def bulkop
    @logs = Wco::Log.find params[:ids]
    authorize! :delete, @logs
    case params[:verb]
    when 'delete'
      @logs.map &:delete
    end
    flash_notice "Probably ok"
    redirect_to request.referrer
  end

  def create
    @log = Wco::Log.new( params[:log].permit! )
    authorize! :create, @log

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

  def destroy
    @log = Wco::Log.find params[:id]
    authorize! :delete, @log
    @log.delete
    flash_notice "Probably ok"
    redirect_to action: :index
  end

  def new
    authorize! :new, Wco::Log
  end

  def edit
    @log = Wco::Log.find params[:id]
    authorize! :edit, @log
  end

  def index
    authorize! :index, Wco::Log
    @logs = Wco::Log.all.page( params[:logs_page] ).per( current_profile.per_page )
    render '_index'
  end

  def update
    @log = Wco::Log.find params[:id]
    authorize! :update, @log

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


end

Version data entries

152 entries across 152 versions & 1 rubygems

Version Path
wco_models-3.1.0.199 app/controllers/wco/logs_controller.rb
wco_models-3.1.0.198 app/controllers/wco/logs_controller.rb
wco_models-3.1.0.197 app/controllers/wco/logs_controller.rb
wco_models-3.1.0.196 app/controllers/wco/logs_controller.rb
wco_models-3.1.0.195 app/controllers/wco/logs_controller.rb
wco_models-3.1.0.194 app/controllers/wco/logs_controller.rb
wco_models-3.1.0.193 app/controllers/wco/logs_controller.rb
wco_models-3.1.0.192 app/controllers/wco/logs_controller.rb
wco_models-3.1.0.191 app/controllers/wco/logs_controller.rb
wco_models-3.1.0.190 app/controllers/wco/logs_controller.rb
wco_models-3.1.0.189 app/controllers/wco/logs_controller.rb
wco_models-3.1.0.188 app/controllers/wco/logs_controller.rb
wco_models-3.1.0.187 app/controllers/wco/logs_controller.rb
wco_models-3.1.0.184 app/controllers/wco/logs_controller.rb
wco_models-3.1.0.183 app/controllers/wco/logs_controller.rb
wco_models-3.1.0.182 app/controllers/wco/logs_controller.rb
wco_models-3.1.0.181 app/controllers/wco/logs_controller.rb
wco_models-3.1.0.180 app/controllers/wco/logs_controller.rb
wco_models-3.1.0.178 app/controllers/wco/logs_controller.rb
wco_models-3.1.0.177 app/controllers/wco/logs_controller.rb