Module: Blacklight::SearchHistory

Extended by:
ActiveSupport::Concern
Includes:
Configurable
Included in:
SearchHistoryController
Defined in:
app/controllers/concerns/blacklight/search_history.rb

Instance Attribute Summary

Attributes included from Configurable

#blacklight_config

Instance Method Summary collapse

Methods included from Configurable

default_configuration, default_configuration=

Instance Method Details

#clearObject

TODO: we may want to remove unsaved (those without user_id) items from the database when removed from history



17
18
19
20
21
22
23
24
25
# File 'app/controllers/concerns/blacklight/search_history.rb', line 17

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

#indexObject



11
12
13
# File 'app/controllers/concerns/blacklight/search_history.rb', line 11

def index
  @searches = searches_from_history
end