Sha256: a08e9c62ddc817dab82bde79fa535f6d594a44a66a3706bbeb8959bdbce38c80
Contents?: true
Size: 1.19 KB
Versions: 11
Compression:
Stored size: 1.19 KB
Contents
class Iro::StrategiesController < Iro::ApplicationController before_action :set_lists def new @strategy = Iro::Strategy.new authorize! :new, @posision end def create @strategy = Iro::Strategy.new params[:strategy].permit! authorize! :create, @strategy if @strategy.save flash_notice @strategy else flash_alert @strategy end redirect_to action: :index end def destroy @strategy = Iro::Strategy.find params[:id] authorize! :destroy, @strategy @strategy.delete flash_notice "Probably ok" redirect_to request.referrer end def edit @strategy = Iro::Strategy.find params[:id] authorize! :edit, @strategy end def index authorize! :index, Iro::Strategy @strategies = Iro::Strategy.all render '_table' end def update @strategy = Iro::Strategy.find params[:id] authorize! :update, @strategy if @strategy.update params[:strategy].permit! flash_notice @strategy else flash_alert @strategy end redirect_to action: :index end ## ## private ## private def set_lists @strategies_list = Iro::Strategy.list @tickers_list = Iro::Stock.tickers_list end end
Version data entries
11 entries across 11 versions & 1 rubygems