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