Sha256: aa1238d1a076fcd07a856a08c2920edc24929792bf4ae5f9adc5ba6a8c1ca8f6

Contents?: true

Size: 644 Bytes

Versions: 24

Compression:

Stored size: 644 Bytes

Contents

# frozen_string_literal: true

require 'action_controller/base'

module EacRailsUtils
  module Patches
    module ActionControllerBasePatch
      def self.included(base)
        base.include InstanceMethods
      end

      module InstanceMethods
        def redirect_back(default_path, options = {})
          redirect_to :back, options
        rescue ActionController::RedirectBackError
          redirect_to default_path, options
        end
      end
    end
  end
end

patch = ::EacRailsUtils::Patches::ActionControllerBasePatch
target = ::ActionController::Base
target.send(:include, patch) unless target.included_modules.include?(patch)

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
eac_rails_utils-0.17.0 lib/eac_rails_utils/patches/action_controller_base.rb
eac_rails_utils-0.16.0 lib/eac_rails_utils/patches/action_controller_base.rb
eac_rails_utils-0.15.2 lib/eac_rails_utils/patches/action_controller_base.rb
eac_rails_utils-0.15.1 lib/eac_rails_utils/patches/action_controller_base.rb
eac_rails_utils-0.15.0 lib/eac_rails_utils/patches/action_controller_base.rb
eac_rails_utils-0.14.1 lib/eac_rails_utils/patches/action_controller_base.rb
eac_rails_utils-0.14.0 lib/eac_rails_utils/patches/action_controller_base.rb
eac_rails_utils-0.13.5 lib/eac_rails_utils/patches/action_controller_base.rb
eac_rails_utils-0.13.4 lib/eac_rails_utils/patches/action_controller_base.rb
eac_rails_utils-0.13.3 lib/eac_rails_utils/patches/action_controller_base.rb
eac_rails_utils-0.13.2 lib/eac_rails_utils/patches/action_controller_base.rb
eac_rails_utils-0.13.1 lib/eac_rails_utils/patches/action_controller_base.rb
eac_rails_utils-0.13.0 lib/eac_rails_utils/patches/action_controller_base.rb
eac_rails_utils-0.12.3 lib/eac_rails_utils/patches/action_controller_base.rb
eac_rails_utils-0.12.2 lib/eac_rails_utils/patches/action_controller_base.rb
eac_rails_utils-0.12.1 lib/eac_rails_utils/patches/action_controller_base.rb
eac_rails_utils-0.12.0 lib/eac_rails_utils/patches/action_controller_base.rb
eac_rails_utils-0.11.6 lib/eac_rails_utils/patches/action_controller_base.rb
eac_rails_utils-0.11.5 lib/eac_rails_utils/patches/action_controller_base.rb
eac_rails_utils-0.11.4 lib/eac_rails_utils/patches/action_controller_base.rb