Class: Spree::Api::ClassificationsController
- Inherits:
-
BaseController
- Object
- ActionController::Base
- BaseController
- Spree::Api::ClassificationsController
- Defined in:
- app/controllers/spree/api/classifications_controller.rb
Instance Attribute Summary
Attributes inherited from BaseController
Instance Method Summary collapse
Instance Method Details
#update ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'app/controllers/spree/api/classifications_controller.rb', line 6 def update :update, Product :update, Taxon classification = Spree::Classification.find_by( product_id: params[:product_id], taxon_id: params[:taxon_id] ) # Because position we get back is 0-indexed. # acts_as_list is 1-indexed. classification.insert_at(params[:position].to_i + 1) head :ok end |