Class: Spotlight::ResourcesController
Instance Method Summary
collapse
Methods included from Controller
#blacklight_config, #current_exhibit, #current_masthead, #current_masthead=, #default_masthead?, #exhibit_masthead?, #exhibit_search_action_url, #exhibit_search_facet_url, #search_action_url, #search_facet_url
Methods included from Config
#exhibit_specific_blacklight_config
Instance Method Details
#create ⇒ Object
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
# File 'app/controllers/spotlight/resources_controller.rb', line 24
def create
@resource.attributes = resource_params
@resource = @resource.becomes_provider
if @resource.save_and_commit
if
render layout: false, text: "<html><script>window.close();</script></html>"
else
redirect_to admin_exhibit_catalog_index_path(@resource.exhibit, sort: :timestamp)
end
else
render action: 'new'
end
end
|
#new ⇒ Object
11
12
13
14
15
16
17
18
19
20
21
22
|
# File 'app/controllers/spotlight/resources_controller.rb', line 11
def new
@resource.attributes = resource_params if params[:resource]
@resource = @resource.becomes_provider
if
render layout: 'spotlight/popup'
else
render
end
end
|
#reindex_all ⇒ Object
39
40
41
42
43
|
# File 'app/controllers/spotlight/resources_controller.rb', line 39
def reindex_all
@exhibit.reindex_later
redirect_to admin_exhibit_catalog_index_path(@exhibit), notice: t(:'spotlight.resources.reindexing_in_progress')
end
|