Sha256: b89456f209726ef88171355ef3475dacbb93ccb4c37553bceddd5f94975159c6
Contents?: true
Size: 368 Bytes
Versions: 7
Compression:
Stored size: 368 Bytes
Contents
module Comfy::ReorderAction extend ActiveSupport::Concern included do mattr_accessor :reorder_action_resource end def reorder resource_class = self.class.reorder_action_resource (params.permit(order: [])[:order] || []).each_with_index do |id, index| resource_class.where(id: id).update_all(position: index) end head :ok end end
Version data entries
7 entries across 7 versions & 1 rubygems