Class: IshManager::StockOptionsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- IshManager::StockOptionsController
- Defined in:
- app/controllers/ish_manager/trash/stock_options_controller.rb
Instance Method Summary collapse
Methods inherited from ApplicationController
Instance Method Details
#create ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'app/controllers/ish_manager/trash/stock_options_controller.rb', line 12 def create @stock_option = Ish::StockOption.new params[:ish_stock_option].permit! @stock_option.profile = current_user.profile :create, @stock_option flag = @stock_option.save if flag flash[:notice] = 'Created stock option.' else flash[:alert] = "Cannot create stock option: #{@stock_option.errors.}" end redirect_to :action => 'index' end |
#index ⇒ Object
4 5 6 7 8 9 10 |
# File 'app/controllers/ish_manager/trash/stock_options_controller.rb', line 4 def index :index, Ish::StockOption @profiles = IshModels::UserProfile.all @stock_options = Ish::StockOption.all.includes( :profile ) @stock_option = Ish::StockOption.new render 'index', :layout => 'ish_manager/application_no_materialize' end |
#update ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 |
# File 'app/controllers/ish_manager/trash/stock_options_controller.rb', line 26 def update @stock_option = Ish::StockOption.find params[:id] :update, @stock_option flag = @stock_option.update_attributes params[:ish_stock_option].permit! if flag flash[:notice] = 'Updated stock option.' else flash[:alert] = "Cannot update stock option: #{@stock_option.errors.}" end redirect_to :action => 'index' end |