Sha256: 5cc146482e4629b207b17686a22e57cd3bf62e7f1fb27f1be9cf3dd3d730267d

Contents?: true

Size: 831 Bytes

Versions: 44

Compression:

Stored size: 831 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

      if respond_to? :redirect_back
        redirect_back fallback_location: blacklight.search_history_path
      else
        # Deprecated in Rails 5.0
        redirect_to :back
      end
    end
  end
end

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
blacklight-6.25.0 app/controllers/concerns/blacklight/search_history.rb
blacklight-6.24.0 app/controllers/concerns/blacklight/search_history.rb
blacklight-6.23.0 app/controllers/concerns/blacklight/search_history.rb
blacklight-6.22.0 app/controllers/concerns/blacklight/search_history.rb
blacklight-6.21.0 app/controllers/concerns/blacklight/search_history.rb
blacklight-6.20.0 app/controllers/concerns/blacklight/search_history.rb
blacklight-6.19.2 app/controllers/concerns/blacklight/search_history.rb
blacklight-6.19.1 app/controllers/concerns/blacklight/search_history.rb
blacklight-6.19.0 app/controllers/concerns/blacklight/search_history.rb
blacklight-6.18.0 app/controllers/concerns/blacklight/search_history.rb
blacklight-6.17.0 app/controllers/concerns/blacklight/search_history.rb
blacklight-6.16.0 app/controllers/concerns/blacklight/search_history.rb
blacklight-6.15.0 app/controllers/concerns/blacklight/search_history.rb
blacklight-7.0.0.rc1 app/controllers/concerns/blacklight/search_history.rb
blacklight-6.14.1 app/controllers/concerns/blacklight/search_history.rb
blacklight-6.14.0 app/controllers/concerns/blacklight/search_history.rb
blacklight-6.13.0 app/controllers/concerns/blacklight/search_history.rb
blacklight-6.12.0 app/controllers/concerns/blacklight/search_history.rb
blacklight-6.11.2 app/controllers/concerns/blacklight/search_history.rb
blacklight-6.11.1 app/controllers/concerns/blacklight/search_history.rb