app/controllers/collections_controller.rb
# TODO - review these. There are too many and as a result there's some redundancy in, for example, checking whether the user is logged in on unpublished
# collections
review these. There are too many and as a result there's some redundancy in, for example, checking whether the user is logged in on unpublished
collections
review these . There are too many and as a result there ' s some redundancy in for example checking whether the user is logged in on unpublished collections
def remove_and_redirect
    begin
      count = remove_items(from: @collection, items: params[:collection_items], scope: params[:scope])
    rescue EOL::Exceptions::NoItemsSelected
      flash[:error] = I18n.t(:collection_error_no_items_selected)
      return redirect_to collection_path(@collection), status: :moved_permanently
    rescue EOL::Exceptions::MaxCollectionItemsExceeded
      flash[:error] = I18n.t(:max_collection_items_error, max: $MAX_COLLECTION_ITEMS_TO_MANIPULATE)
      return redirect_to collection_path(@collection), status: :moved_permanently
    end
    flash[:notice] = I18n.t(:removed_count_items_from_collection_notice, count: count)
    return redirect_to collection_path(@collection), status: :moved_permanently
  end
def remove_and_redirect begin count = remove_items ( from : @collection , items : params [ :collection_items ] , scope : params [ :scope ] ) rescue EOL :: Exceptions :: NoItemsSelected flash [ :error ] = I18n . t ( :collection_error_no_items_selected ) return redirect_to collection_path ( @collection ) , status : :moved_permanently rescue EOL :: Exceptions :: MaxCollectionItemsExceeded flash [ :error ] = I18n . t ( :max_collection_items_error , max : $MAX_COLLECTION_ITEMS_TO_MANIPULATE ) return redirect_to collection_path ( @collection ) , status : :moved_permanently end flash [ :notice ] = I18n . t ( :removed_count_items_from_collection_notice , count : count ) return redirect_to collection_path ( @collection ) , status : :moved_permanently end
TODO - review these.
TODO - review these .