Sha256: dfa030645a9329be24cdf8d0a68fabef68ec9f22a72eb8ab127705a66dfce90e

Contents?: true

Size: 837 Bytes

Versions: 1

Compression:

Stored size: 837 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')
      end

      initializer 'impartial.paths' do |app|
        app.config.assets.paths << ::Rails.root.join('app', 'impartials')
        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.4 lib/impartial-rails/railtie.rb