Sha256: 02a9fadc29a87fcd1677092824dc96e04ba2707aed896425b7f56c232cb63dd0
Contents?: true
Size: 346 Bytes
Versions: 139
Compression:
Stored size: 346 Bytes
Contents
module SortableActions extend ActiveSupport::Concern def reorder params[:ids_in_order].each_with_index do |id, sort_order| if (child_object = @parent_object.send(@child_collection).find_by_id(id)) child_object.sort_order = sort_order child_object.save end end render json: true, status: :ok end end
Version data entries
139 entries across 139 versions & 1 rubygems