Sha256: db83a9d10fe4bb47e13e985c885065a9f72ea47f9d3ad0a138343592e6ab0862

Contents?: true

Size: 864 Bytes

Versions: 54

Compression:

Stored size: 864 Bytes

Contents

module CurationConcerns
  module RenderConstraintsHelper
    # 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
    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

    # @return [Array<Symbol>] a list of fields to remove on the render_constraint_element
    # You can override this if you have different fields to remove
    def fields_to_exclude_from_constraint_element
      [:search_field]
    end
  end
end

Version data entries

54 entries across 54 versions & 1 rubygems

Version Path
curation_concerns-1.7.8 app/helpers/curation_concerns/render_constraints_helper.rb
curation_concerns-1.7.7 app/helpers/curation_concerns/render_constraints_helper.rb
curation_concerns-2.0.0 app/helpers/curation_concerns/render_constraints_helper.rb
curation_concerns-2.0.0.rc2 app/helpers/curation_concerns/render_constraints_helper.rb
curation_concerns-1.7.6 app/helpers/curation_concerns/render_constraints_helper.rb
curation_concerns-1.7.5 app/helpers/curation_concerns/render_constraints_helper.rb
curation_concerns-1.7.4 app/helpers/curation_concerns/render_constraints_helper.rb
curation_concerns-1.7.3 app/helpers/curation_concerns/render_constraints_helper.rb
curation_concerns-1.7.2 app/helpers/curation_concerns/render_constraints_helper.rb
curation_concerns-2.0.0.rc1 app/helpers/curation_concerns/render_constraints_helper.rb
curation_concerns-1.7.1 app/helpers/curation_concerns/render_constraints_helper.rb
curation_concerns-1.7.0 app/helpers/curation_concerns/render_constraints_helper.rb
curation_concerns-1.7.0.beta1 app/helpers/curation_concerns/render_constraints_helper.rb
curation_concerns-1.6.3 app/helpers/curation_concerns/render_constraints_helper.rb
curation_concerns-1.6.2 app/helpers/curation_concerns/render_constraints_helper.rb
curation_concerns-1.6.1 app/helpers/curation_concerns/render_constraints_helper.rb
curation_concerns-1.6.0 app/helpers/curation_concerns/render_constraints_helper.rb
curation_concerns-1.5.0 app/helpers/curation_concerns/render_constraints_helper.rb
curation_concerns-1.4.0 app/helpers/curation_concerns/render_constraints_helper.rb
curation_concerns-1.3.3 app/helpers/curation_concerns/render_constraints_helper.rb