Module: BlacklightFacetExtras::Filter::ControllerExtension

Defined in:
lib/blacklight_facet_extras/filter/controller_extension.rb

Overview

Meant to be applied on top of a controller that implements Blacklight::SolrHelper. Will inject filter limiting behaviors to solr parameters creation.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(some_class) ⇒ Object



5
6
7
8
9
# File 'lib/blacklight_facet_extras/filter/controller_extension.rb', line 5

def self.included(some_class)
  some_class.send :include,BlacklightFacetExtras::ControllerExtension
  some_class.helper_method :facet_filter_config
  some_class.helper BlacklightFacetExtras::Filter::ViewHelperExtension
end

Instance Method Details

#blacklight_filter_configObject



16
17
18
# File 'lib/blacklight_facet_extras/filter/controller_extension.rb', line 16

def blacklight_filter_config
  Blacklight.config[:facet][:filter] || {}
end

#facet_filter_config(solr_field) ⇒ Object



10
11
12
13
14
# File 'lib/blacklight_facet_extras/filter/controller_extension.rb', line 10

def facet_filter_config(solr_field)
  config = blacklight_filter_config[solr_field] || false
  config = {} if config == true
  config
end