Sha256: 5219ac070d2d41a0fcba3615302d03089748abf0add013c7fa65c387d6b63233
Contents?: true
Size: 533 Bytes
Versions: 6
Compression:
Stored size: 533 Bytes
Contents
module Spree module Api class ClassificationsController < Spree::Api::BaseController def update authorize! :update, Product authorize! :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) render nothing: true end end end end
Version data entries
6 entries across 6 versions & 1 rubygems