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
20 21 22 23 24 25 26 27 28 |
# File 'app/controllers/iro/stocks_controller.rb', line 20 def create @stock = Iro::Stock.new(stock_params) if @stock.save redirect_to action: :index, notice: 'Stock was successfully created.' else render :new end end |
#destroy ⇒ Object
38 39 40 41 |
# File 'app/controllers/iro/stocks_controller.rb', line 38 def destroy @stock.destroy redirect_to stocks_url, notice: 'Stock was successfully destroyed.' end |
#edit ⇒ Object
17 18 |
# File 'app/controllers/iro/stocks_controller.rb', line 17 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 |
# File 'app/controllers/iro/stocks_controller.rb', line 13 def new @stock = Iro::Stock.new end |
#show ⇒ Object
10 11 |
# File 'app/controllers/iro/stocks_controller.rb', line 10 def show end |
#update ⇒ Object
30 31 32 33 34 35 36 |
# File 'app/controllers/iro/stocks_controller.rb', line 30 def update if @stock.update(stock_params) redirect_to @stock, notice: 'Stock was successfully updated.' else render :edit end end |