Sha256: d77716b605605eabcf1ff5ad2d43a167faefc09f7ff9fb9489b015b495f123e1

Contents?: true

Size: 834 Bytes

Versions: 1

Compression:

Stored size: 834 Bytes

Contents

require 'rails/railtie'
require 'impartial/base'

module Impartial
  module Rails
    class Railtie < ::Rails::Railtie

      initializer 'impartial.autoload', :before => :set_autoload_paths do |app|
        app.config.autoload_paths << ::Rails.root.join('app', 'impartials')
        app.config.assets.paths << Rails.root.join('app', 'impartials')
      end

      initializer 'impartial.paths' do |app|
        Impartial.configure do |config|
          config.paths = [::Rails.root.join('app', 'impartials')]
        end
      end

      initializer "impartial.add_helper" do |app|
        ::Impartial::Base.class_eval do
          include app.routes.url_helpers
          include ::ApplicationHelper
          include ::ActionView::Helpers
          include ::Sprockets::Helpers::RailsHelper
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
impartial-rails-0.0.2 lib/impartial-rails/railtie.rb