Sha256: f5cb87f85076fa8806d2540c79c32b259de4ee27cf2ad4186a3a0bb6efa7e3cb
Contents?: true
Size: 953 Bytes
Versions: 45
Compression:
Stored size: 953 Bytes
Contents
require 'active_tools/action_pack/action_controller/path_helper/complex_helpers' module ActiveTools module ActionPack module ActionController module PathHelper class HttpReferer attr_reader :url, :recognized include ComplexHelpers delegate :[], :to => :recognized def initialize(request, environment = {}) @url = request.env['HTTP_REFERER'] @recognized = begin @url.present? ? Rails.application.routes.recognize_path(@url, environment) : {} rescue ::ActionController::RoutingError {} end @recognized.freeze end def current_controller recognized[:controller] end def current_action recognized[:action] end def to_s @url end end end end end end
Version data entries
45 entries across 45 versions & 1 rubygems