Sha256: 15f2166fe45e8d722de7bd49ff3acc66daae88815bb34980e81339fc322b8fd3

Contents?: true

Size: 609 Bytes

Versions: 10

Compression:

Stored size: 609 Bytes

Contents

# frozen_string_literal: true
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

10 entries across 10 versions & 1 rubygems

Version Path
eac_rails_utils-0.8.0 lib/eac_rails_utils/patches/action_controller_base.rb
eac_rails_utils-0.7.1 lib/eac_rails_utils/patches/action_controller_base.rb
eac_rails_utils-0.7.0 lib/eac_rails_utils/patches/action_controller_base.rb
eac_rails_utils-0.6.0 lib/eac_rails_utils/patches/action_controller_base.rb
eac_rails_utils-0.5.0 lib/eac_rails_utils/patches/action_controller_base.rb
eac_rails_utils-0.4.0 lib/eac_rails_utils/patches/action_controller_base.rb
eac_rails_utils-0.3.0 lib/eac_rails_utils/patches/action_controller_base.rb
eac_rails_utils-0.2.2 lib/eac_rails_utils/patches/action_controller_base.rb
eac_rails_utils-0.2.1 lib/eac_rails_utils/patches/action_controller_base.rb
eac_rails_utils-0.2.0 lib/eac_rails_utils/patches/action_controller_base.rb