Sha256: 488c5ca6f9ca538de0dd928359c43d3c4f4d2c4aa9a5e8ae993a661e0426b283
Contents?: true
Size: 1.39 KB
Versions: 35
Compression:
Stored size: 1.39 KB
Contents
class ::IshManager::IroPositionsController < IshManager::ApplicationController before_action :set_lists def create @position = Iro::Position.new({ type: 'Iro::CoveredCall', }) authorize! :update, @position if @position.update params[:iro_position].permit! flash[:notice] = 'Successfully updated position.' redirect_to controller: 'iro_purses', action: :show, id: params[:iro_position][:iro_purse_id] else flash[:alert] = "Cannot update position: #{@position.errors.full_messages.join(', ')}." render action: 'edit' end end def edit @position = Iro::Position.find params[:id] authorize! :edit, @position end def new @position = Iro::Position.new authorize! :new, @position end ## prepare to roll def roll @position = Iro::Position.find( params[:id] ) # puts! @position, 'zze' authorize! :roll, @position @next_positions = Iro::Position.find( 13, 14, 15, 16 ) end def update @position = Iro::Position.find params[:id] authorize! :update, @position if @position.update params[:iro_position].permit! flash[:notice] = 'Successfully updated position.' redirect_to controller: 'iro_purses', action: :show, id: @position[:iro_purse_id] else flash[:alert] = "Cannot update position: #{@position.errors.full_messages.join(', ')}." render action: 'edit' end end end
Version data entries
35 entries across 35 versions & 1 rubygems