Sha256: 778ccfa8e0bb4ca232d61d02473dfd07e6db7cfd06702cf34f96d12d3c77254f

Contents?: true

Size: 627 Bytes

Versions: 1

Compression:

Stored size: 627 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
      ::I18n.load_path += Dir[File.dirname(__FILE__) + "/../../locales/*.yml"]
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

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