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
10
# 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_method :blacklight_filter_config
  some_class.helper BlacklightFacetExtras::Filter::ViewHelperExtension
end

Instance Method Details

#blacklight_filter_configObject



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

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

#facet_filter_config(solr_field) ⇒ Object



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

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