Class: Spree::Api::StockMovementsController
- Inherits:
-
BaseController
- Object
- ActionController::Base
- BaseController
- Spree::Api::StockMovementsController
- Defined in:
- app/controllers/spree/api/stock_movements_controller.rb
Instance Attribute Summary
Attributes inherited from BaseController
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'app/controllers/spree/api/stock_movements_controller.rb', line 19 def create :create, StockMovement @stock_movement = scope.new(stock_movement_params) if @stock_movement.save respond_with(@stock_movement, status: 201, default_template: :show) else invalid_resource!(@stock_movement) end end |
#index ⇒ Object
8 9 10 11 12 |
# File 'app/controllers/spree/api/stock_movements_controller.rb', line 8 def index :index, StockMovement @stock_movements = paginate(scope.ransack(params[:q]).result) respond_with(@stock_movements) end |
#show ⇒ Object
14 15 16 17 |
# File 'app/controllers/spree/api/stock_movements_controller.rb', line 14 def show @stock_movement = scope.find(params[:id]) respond_with(@stock_movement) end |