def sort
        params[:ids].each.with_index do |id, index|
          Page.where(id: id).update_all(position: index + 1)
        end