Sha256: 39b3048bc36c8441e6180e66ec3ba474813d0899da3201c5c69be745096565e2

Contents?: true

Size: 548 Bytes

Versions: 2

Compression:

Stored size: 548 Bytes

Contents

require "rails/railtie"

module SimpleHelpers
  class Railtie < Rails::Railtie

    generators do
      require "simple_helpers/generators"
    end

    initializer "simple_helpers.initialize" do
      ::ActionController::Base.instance_eval do
        include SimpleHelpers::ActionController

        initialize_method = instance_method(:initialize)

        define_method :initialize do |*args|
          simple_helper(SimpleHelpers::Config.helpers.keys)

          initialize_method.bind(self).call(*args)
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
simple_helpers-2.0.1 lib/simple_helpers/railtie.rb
simple_helpers-2.0.0 lib/simple_helpers/railtie.rb