Class: Spotlight::Resources::UploadController

Inherits:
ApplicationController show all
Defined in:
app/controllers/spotlight/resources/upload_controller.rb

Overview

Creating new exhibit items from single-item entry forms or batch CSV upload

Instance Method Summary collapse

Methods included from Concerns::ApplicationController

#enabled_in_spotlight_view_type_configuration?, #field_enabled?

Methods included from Controller

#add_breadcrumb, #blacklight_config, #breadcrumbs, #current_exhibit, #current_masthead, #current_masthead=, #current_site, #default_url_options, #exhibit_masthead?, #exhibit_search_action_url, #exhibit_search_facet_path, #resource_masthead?, #search_action_url, #search_facet_path, #search_state, #set_exhibit_locale_scope, #set_locale

Methods included from Config

#exhibit_specific_blacklight_config

Instance Method Details

#createObject



19
20
21
22
23
24
25
26
27
28
# File 'app/controllers/spotlight/resources/upload_controller.rb', line 19

def create
  if @resource.save_and_index
    flash[:notice] = t('spotlight.resources.upload.success')
    return redirect_to new_exhibit_resource_path(@resource.exhibit, tab: :upload) if params['add-and-continue']
  else
    flash[:error] = t('spotlight.resources.upload.error')
  end

  redirect_to admin_exhibit_catalog_path(@resource.exhibit, sort: :timestamp)
end