Sha256: a6fee00830bc6f806464685e0b1ed2683201e5b1fa3a39acb5bcb533abf8d8f6

Contents?: true

Size: 732 Bytes

Versions: 73

Compression:

Stored size: 732 Bytes

Contents

# frozen_string_literal: true

module ControllerLevelHelpers
  def search_state
    @search_state ||= Blacklight::SearchState.new(params, blacklight_config)
  end

  def current_site
    Spotlight::Site.instance
  end

  def blacklight_configuration_context
    @blacklight_configuration_context ||= Blacklight::Configuration::Context.new(controller)
  end

  def initialize_controller_helpers(helper)
    helper.extend ControllerLevelHelpers
    initialize_routing_helpers(helper)
  end

  def initialize_routing_helpers(helper)
    helper.class.include ::Rails.application.routes.url_helpers
    helper.class.include ::Rails.application.routes.mounted_helpers if ::Rails.application.routes.respond_to?(:mounted_helpers)
  end
end

Version data entries

73 entries across 73 versions & 1 rubygems

Version Path
blacklight-spotlight-4.3.6 spec/support/helpers/controller_level_helpers.rb
blacklight-spotlight-4.3.5 spec/support/helpers/controller_level_helpers.rb
blacklight-spotlight-4.3.4 spec/support/helpers/controller_level_helpers.rb
blacklight-spotlight-4.3.3 spec/support/helpers/controller_level_helpers.rb
blacklight-spotlight-4.3.2 spec/support/helpers/controller_level_helpers.rb
blacklight-spotlight-4.3.1 spec/support/helpers/controller_level_helpers.rb
blacklight-spotlight-4.3.0 spec/support/helpers/controller_level_helpers.rb
blacklight-spotlight-4.2.0 spec/support/helpers/controller_level_helpers.rb
blacklight-spotlight-4.1.2 spec/support/helpers/controller_level_helpers.rb
blacklight-spotlight-4.1.1 spec/support/helpers/controller_level_helpers.rb
blacklight-spotlight-4.1.0 spec/support/helpers/controller_level_helpers.rb
blacklight-spotlight-4.0.3 spec/support/helpers/controller_level_helpers.rb
blacklight-spotlight-4.0.2 spec/support/helpers/controller_level_helpers.rb
blacklight-spotlight-4.0.1 spec/support/helpers/controller_level_helpers.rb
blacklight-spotlight-4.0.0 spec/support/helpers/controller_level_helpers.rb
blacklight-spotlight-3.6.0.beta10 spec/support/helpers/controller_level_helpers.rb
blacklight-spotlight-3.6.0.beta9 spec/support/helpers/controller_level_helpers.rb
blacklight-spotlight-3.6.0.beta8 spec/support/helpers/controller_level_helpers.rb
blacklight-spotlight-3.5.0.4 spec/support/helpers/controller_level_helpers.rb
blacklight-spotlight-3.6.0.beta7 spec/support/helpers/controller_level_helpers.rb