Module: CurationConcerns::RenderConstraintsHelper

Included in:
MainAppHelpers
Defined in:
app/helpers/curation_concerns/render_constraints_helper.rb

Instance Method Summary collapse

Instance Method Details

#fields_to_exclude_from_constraint_elementArray<Symbol>

You can override this if you have different fields to remove

Returns:

  • (Array<Symbol>)

    a list of fields to remove on the render_constraint_element



17
18
19
# File 'app/helpers/curation_concerns/render_constraints_helper.rb', line 17

def fields_to_exclude_from_constraint_element
  [:search_field]
end

#remove_constraint_url(localized_params) ⇒ Object

This overrides Blacklight to remove the ‘search_field’ tag from the localized params when the query is cleared. This is because unlike Blacklight, there is no control to change the search_field in the curation_concerns UI



7
8
9
10
11
12
13
# File 'app/helpers/curation_concerns/render_constraints_helper.rb', line 7

def remove_constraint_url(localized_params)
  scope = localized_params.delete(:route_set) || self
  options = localized_params.merge(q: nil, action: 'index')
                            .except(*fields_to_exclude_from_constraint_element)
  options.permit!
  scope.url_for(options)
end