Sha256: 66e942ca05c9d31e70a85330fd571fc45f4adf35cdde6fa4387876bbe74771b2

Contents?: true

Size: 1.06 KB

Versions: 125

Compression:

Stored size: 1.06 KB

Contents

class IshManager::StockWatchesController < IshManager::ApplicationController

  def index
    authorize! :index, Ish::StockWatch
    @profiles = IshModels::UserProfile.all
    @stock_watches = Ish::StockWatch.all.includes( :profile )
    @stock_watch = Ish::StockWatch.new
    render 'index', :layout => 'ish_manager/application_no_materialize'
  end

  def create
    @stock_watch = Ish::StockWatch.new params[:ish_stock_watch].permit!
    authorize! :create, @stock_watch
    flag = @stock_watch.save
    if flag
      flash[:notice] = 'Created stock watch.'
    else
      flash[:alert] = "Cannot create stock watch: #{@stock_watch.errors.messages}"
    end
    redirect_to :action => 'index'
  end

  def update
    @stock_watch = Ish::StockWatch.find params[:id]
    authorize! :update, @stock_watch
    flag = @stock_watch.update_attributes params[:ish_stock_watch].permit!
    if flag
      flash[:notice] = 'Updated stock watch.'
    else
      flash[:alert] = "Cannot update stock watch: #{@stock_watch.errors.messages}"
    end
    redirect_to :action => 'index'
  end

end



Version data entries

125 entries across 125 versions & 1 rubygems

Version Path
ish_manager-0.1.8.124 app/controllers/ish_manager/stock_watches_controller.rb
ish_manager-0.1.8.123 app/controllers/ish_manager/stock_watches_controller.rb
ish_manager-0.1.8.122 app/controllers/ish_manager/stock_watches_controller.rb
ish_manager-0.1.8.121 app/controllers/ish_manager/stock_watches_controller.rb
ish_manager-0.1.8.120 app/controllers/ish_manager/stock_watches_controller.rb
ish_manager-0.1.8.119 app/controllers/ish_manager/stock_watches_controller.rb
ish_manager-0.1.8.118 app/controllers/ish_manager/stock_watches_controller.rb
ish_manager-0.1.8.117 app/controllers/ish_manager/stock_watches_controller.rb
ish_manager-0.1.8.116 app/controllers/ish_manager/stock_watches_controller.rb
ish_manager-0.1.8.115 app/controllers/ish_manager/stock_watches_controller.rb
ish_manager-0.1.8.114 app/controllers/ish_manager/stock_watches_controller.rb
ish_manager-0.1.8.113 app/controllers/ish_manager/stock_watches_controller.rb
ish_manager-0.1.8.112 app/controllers/ish_manager/stock_watches_controller.rb
ish_manager-0.1.8.111 app/controllers/ish_manager/stock_watches_controller.rb
ish_manager-0.1.8.110 app/controllers/ish_manager/stock_watches_controller.rb
ish_manager-0.1.8.109 app/controllers/ish_manager/stock_watches_controller.rb
ish_manager-0.1.8.108 app/controllers/ish_manager/stock_watches_controller.rb
ish_manager-0.1.8.107 app/controllers/ish_manager/stock_watches_controller.rb
ish_manager-0.1.8.106 app/controllers/ish_manager/stock_watches_controller.rb
ish_manager-0.1.8.105 app/controllers/ish_manager/stock_watches_controller.rb