Sha256: 7e2bf4563b7afbdf695c0c40c1be1c3b32a2e8c3c694a89817e0b9f2178bad78
Contents?: true
Size: 521 Bytes
Versions: 37
Compression:
Stored size: 521 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) head :ok end end end end
Version data entries
37 entries across 37 versions & 1 rubygems