class Wco::GalleriesController
def update_ordering
def update_ordering authorize! :update, @gallery flags = [] params[:ids].each_with_index do |id, idx| flags.push Wco::Photo.find( id ).update( weight: idx ) end flash_notice "Ordering photos: #{flags}" redirect_to request.referrer end