Sha256: d7c2cbe03c1a0de5a8bd6728e53b043223e7d8f3a9f3588608427c59a14488d0

Contents?: true

Size: 611 Bytes

Versions: 6

Compression:

Stored size: 611 Bytes

Contents

# frozen_string_literal: true

#
# Manage cron job servers
#
module CoreController
  extend ActiveSupport::Concern

  protected

  def redirect_to_referrer(default_url)
    redirect_to session.delete(:referrer) || default_url
  end

  def capture_referrer_url
    session[:referrer] = request.referrer
  end

  def clear_referrer_url
    session.delete(:referrer)
  end

  private

  def index_path
    "/#{controller_path}"
  end

  #
  # Handle a document not being found, as this may happen
  #
  def document_not_found_error
    flash.now[:error] = 'Document not found'
    redirect_to index_path
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
web47core-3.2.17 lib/app/controllers/concerns/core_controller.rb
web47core-3.2.16 lib/app/controllers/concerns/core_controller.rb
web47core-3.2.15 lib/app/controllers/concerns/core_controller.rb
web47core-3.2.14 lib/app/controllers/concerns/core_controller.rb
web47core-3.2.13 lib/app/controllers/concerns/core_controller.rb
web47core-3.2.12 lib/app/controllers/concerns/core_controller.rb