Class: Spotlight::ResourcesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- Spotlight::ResourcesController
- Defined in:
- app/controllers/spotlight/resources_controller.rb
Direct Known Subclasses
Instance Method Summary collapse
Methods included from Controller
#blacklight_config, #current_exhibit, #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 if from_popup? render layout: false, text: "<html><script>window.close();</script></html>" else redirect_to admin_exhibit_catalog_index_path(@resource.exhibit) 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 ## TODO: in Rails 4.1, replace this with a variant if from_popup? render layout: 'spotlight/popup' else render end end |