Sha256: 13d4508b145fbf7219c96c5d4137bd5451b98142ecec8b2dfe2ff8fa4c081907

Contents?: true

Size: 561 Bytes

Versions: 11

Compression:

Stored size: 561 Bytes

Contents

# -*- encoding : utf-8 -*-
class SearchHistoryController < ApplicationController
  include Blacklight::Configurable

  copy_blacklight_config_from(CatalogController)

  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] = "Cleared your search history."
    else
      flash[:error] = "There was a problem clearing your search history."
    end
    redirect_to :back
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
blacklight-3.4.2 app/controllers/search_history_controller.rb
blacklight-3.4.1 app/controllers/search_history_controller.rb
blacklight-3.4.0 app/controllers/search_history_controller.rb
blacklight-3.3.2 app/controllers/search_history_controller.rb
blacklight-3.3.1 app/controllers/search_history_controller.rb
blacklight-3.3.0 app/controllers/search_history_controller.rb
blacklight-3.2.2 app/controllers/search_history_controller.rb
blacklight-3.2.1 app/controllers/search_history_controller.rb
blacklight-3.2.0 app/controllers/search_history_controller.rb
blacklight-3.2.0pre2 app/controllers/search_history_controller.rb
blacklight-3.2.0pre1 app/controllers/search_history_controller.rb