Module: Spotlight::Base
- Extended by:
- ActiveSupport::Concern
- Includes:
- Blacklight::Base, Config
- Included in:
- Catalog, DashboardsController, PagesController, SearchesController
- Defined in:
- app/controllers/concerns/spotlight/base.rb
Overview
Base controller mixin
Instance Method Summary collapse
- #autocomplete_json_response(document_list) ⇒ Object
-
#autocomplete_json_response_for_document(doc) ⇒ Object
rubocop:disable Metrics/AbcSize.
-
#blacklight_config ⇒ Object
This overwrites Blacklight::Configurable#blacklight_config.
- #controller_tracking_method ⇒ Object
Methods included from Config
#exhibit_specific_blacklight_config
Instance Method Details
#autocomplete_json_response(document_list) ⇒ Object
25 26 27 28 29 |
# File 'app/controllers/concerns/spotlight/base.rb', line 25 def autocomplete_json_response(document_list) document_list.map do |doc| autocomplete_json_response_for_document doc end end |
#autocomplete_json_response_for_document(doc) ⇒ Object
rubocop:disable Metrics/AbcSize
32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'app/controllers/concerns/spotlight/base.rb', line 32 def autocomplete_json_response_for_document(doc) { id: doc.id, title: CGI.unescapeHTML(view_context.document_presenter(doc).heading.to_str), thumbnail: doc.first(blacklight_config.index.thumbnail_field), full_image_url: doc.first(Spotlight::Engine.config.full_image_field), description: doc.id, url: polymorphic_path([current_exhibit, doc]), private: doc.private?(current_exhibit), global_id: doc.to_global_id.to_s, iiif_manifest: doc[Spotlight::Engine.config.iiif_manifest_field] } end |
#blacklight_config ⇒ Object
This overwrites Blacklight::Configurable#blacklight_config
21 22 23 |
# File 'app/controllers/concerns/spotlight/base.rb', line 21 def blacklight_config exhibit_specific_blacklight_config end |