Sha256: 41096005db912d6a65299578b1b15d7db6387d7b1e90abf9e317d27d01300812

Contents?: true

Size: 680 Bytes

Versions: 24

Compression:

Stored size: 680 Bytes

Contents

# frozen_string_literal: true

# :markup: markdown

require "active_support/core_ext/module/introspection"

module AbstractController
  module Railties
    module RoutesHelpers
      def self.with(routes, include_path_helpers = true)
        Module.new do
          define_method(:inherited) do |klass|
            super(klass)

            if namespace = klass.module_parents.detect { |m| m.respond_to?(:railtie_routes_url_helpers) }
              klass.include(namespace.railtie_routes_url_helpers(include_path_helpers))
            else
              klass.include(routes.url_helpers(include_path_helpers))
            end
          end
        end
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 2 rubygems

Version Path
actionpack-8.0.2 lib/abstract_controller/railties/routes_helpers.rb
actionpack-8.0.1 lib/abstract_controller/railties/routes_helpers.rb
actionpack-8.0.0.1 lib/abstract_controller/railties/routes_helpers.rb
actionpack-7.2.2.1 lib/abstract_controller/railties/routes_helpers.rb
actionpack-8.0.0 lib/abstract_controller/railties/routes_helpers.rb
actionpack-7.2.2 lib/abstract_controller/railties/routes_helpers.rb
actionpack-8.0.0.rc2 lib/abstract_controller/railties/routes_helpers.rb
actionpack-7.2.1.2 lib/abstract_controller/railties/routes_helpers.rb
actionpack-8.0.0.rc1 lib/abstract_controller/railties/routes_helpers.rb
actionpack-7.2.1.1 lib/abstract_controller/railties/routes_helpers.rb
actionpack-8.0.0.beta1 lib/abstract_controller/railties/routes_helpers.rb
omg-actionpack-8.0.0.alpha9 lib/abstract_controller/railties/routes_helpers.rb
omg-actionpack-8.0.0.alpha8 lib/abstract_controller/railties/routes_helpers.rb
omg-actionpack-8.0.0.alpha7 lib/abstract_controller/railties/routes_helpers.rb
omg-actionpack-8.0.0.alpha4 lib/abstract_controller/railties/routes_helpers.rb
omg-actionpack-8.0.0.alpha3 lib/abstract_controller/railties/routes_helpers.rb
omg-actionpack-8.0.0.alpha2 lib/abstract_controller/railties/routes_helpers.rb
omg-actionpack-8.0.0.alpha1 lib/abstract_controller/railties/routes_helpers.rb
actionpack-7.2.1 lib/abstract_controller/railties/routes_helpers.rb
actionpack-7.2.0 lib/abstract_controller/railties/routes_helpers.rb