Class: Spree::Admin::StockMovementsController
- Inherits:
-
BaseController
- Object
- BaseController
- BaseController
- Spree::Admin::StockMovementsController
- Defined in:
- app/controllers/spree/admin/stock_movements_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
17 18 19 20 21 22 |
# File 'app/controllers/spree/admin/stock_movements_controller.rb', line 17 def create @stock_movement = stock_location.stock_movements.build(stock_movement_params) @stock_movement.save flash[:success] = (@stock_movement, :successfully_created) redirect_to admin_stock_location_stock_movements_path(stock_location) end |
#edit ⇒ Object
24 25 26 |
# File 'app/controllers/spree/admin/stock_movements_controller.rb', line 24 def edit @stock_movement = StockMovement.find(params[:id]) end |
#index ⇒ Object
7 8 9 10 11 |
# File 'app/controllers/spree/admin/stock_movements_controller.rb', line 7 def index @stock_movements = stock_location.stock_movements.recent. includes(:stock_item => { :variant => :product }). page(params[:page]) end |
#new ⇒ Object
13 14 15 |
# File 'app/controllers/spree/admin/stock_movements_controller.rb', line 13 def new @stock_movement = stock_location.stock_movements.build end |