Module: Blacklight::SearchHistory

Extended by:
ActiveSupport::Concern
Includes:
Configurable, SearchContext
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 SearchContext

#current_search_session, #page_links, #searches_from_history

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



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

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



13
14
15
# File 'app/controllers/concerns/blacklight/search_history.rb', line 13

def index
  @searches = searches_from_history
end