Class: Iro::StocksController
- Inherits:
-
ApplicationController
- Object
- Wco::ApplicationController
- ApplicationController
- Iro::StocksController
- Defined in:
- app/controllers/iro/stocks_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Methods inherited from ApplicationController
Instance Method Details
#create ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 |
# File 'app/controllers/iro/stocks_controller.rb', line 21 def create @stock = Iro::Stock.new(stock_params) :create, @stock if @stock.save flash_notice @stock else flash_alert @stock end redirect_to action: :index end |
#destroy ⇒ Object
44 45 46 47 |
# File 'app/controllers/iro/stocks_controller.rb', line 44 def destroy @stock.destroy redirect_to stocks_url, notice: 'Stock was successfully destroyed.' end |
#edit ⇒ Object
18 19 |
# File 'app/controllers/iro/stocks_controller.rb', line 18 def edit end |
#index ⇒ Object
5 6 7 8 |
# File 'app/controllers/iro/stocks_controller.rb', line 5 def index @stocks = Iro::Stock.all :index, Iro::Stock end |
#new ⇒ Object
13 14 15 16 |
# File 'app/controllers/iro/stocks_controller.rb', line 13 def new @stock = Iro::Stock.new :new, @stock end |
#show ⇒ Object
10 11 |
# File 'app/controllers/iro/stocks_controller.rb', line 10 def show end |