app/controllers/curate/collections_controller.rb in curate-0.5.1 vs app/controllers/curate/collections_controller.rb in curate-0.5.2
- old
+ new
@@ -57,17 +57,17 @@
if @collection && @collection.add_member(@collectible)
flash[:notice] = "\"#{@collectible}\" has been added to \"#{@collection}\""
else
flash[:error] = 'Unable to add item to collection.'
end
- redirect_to catalog_index_path
+ redirect_to params.fetch(:redirect_to) { catalog_index_path }
end
def remove_member
@collection = Collection.find(params[:id])
item = ActiveFedora::Base.find(params[:item_id], cast:true)
@collection.remove_member(item)
- redirect_to collection_path(params[:id])
+ redirect_to params.fetch(:redirect_to) { collection_path(params[:id]) }
end
private
def load_and_authorize_collectible