Sha256: 204af6a025a5641e64f63af8e35597dec449215d50afe7c3ec53b916401a8423

Contents?: true

Size: 712 Bytes

Versions: 74

Compression:

Stored size: 712 Bytes

Contents

# frozen_string_literal: true
module Blacklight
  module SearchHistory
    extend ActiveSupport::Concern
    include Blacklight::Configurable

    included do
      copy_blacklight_config_from(CatalogController)
    end

    def index
      @searches = searches_from_history
    end

    # TODO: we may want to remove unsaved (those without user_id) items from
    # the database when removed from history
    def clear
      if session[:history].clear
        flash[:notice] = I18n.t('blacklight.search_history.clear.success')
      else
        flash[:error] = I18n.t('blacklight.search_history.clear.failure')
      end

      redirect_back fallback_location: blacklight.search_history_path
    end
  end
end

Version data entries

74 entries across 74 versions & 2 rubygems

Version Path
blacklight-7.40.0 app/controllers/concerns/blacklight/search_history.rb
blacklight-7.39.0 app/controllers/concerns/blacklight/search_history.rb
blacklight-7.38.0 app/controllers/concerns/blacklight/search_history.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/blacklight-7.37.0/app/controllers/concerns/blacklight/search_history.rb
blacklight-7.37.0 app/controllers/concerns/blacklight/search_history.rb
blacklight-7.36.2 app/controllers/concerns/blacklight/search_history.rb
blacklight-7.36.1 app/controllers/concerns/blacklight/search_history.rb
blacklight-7.36.0 app/controllers/concerns/blacklight/search_history.rb
blacklight-7.35.0 app/controllers/concerns/blacklight/search_history.rb
blacklight-7.34.0 app/controllers/concerns/blacklight/search_history.rb
blacklight-7.33.1 app/controllers/concerns/blacklight/search_history.rb
blacklight-7.33.0 app/controllers/concerns/blacklight/search_history.rb
blacklight-7.32.0 app/controllers/concerns/blacklight/search_history.rb
blacklight-7.31.0 app/controllers/concerns/blacklight/search_history.rb
blacklight-7.30.0 app/controllers/concerns/blacklight/search_history.rb
blacklight-7.29.0 app/controllers/concerns/blacklight/search_history.rb
blacklight-7.28.0 app/controllers/concerns/blacklight/search_history.rb
blacklight-7.27.1 app/controllers/concerns/blacklight/search_history.rb
blacklight-7.27.0 app/controllers/concerns/blacklight/search_history.rb
blacklight-7.26.1 app/controllers/concerns/blacklight/search_history.rb