Sha256: 5e40ae8bea76b4dec8446d6168f2fc3095c15bf511f2686873dacb1ab238699e

Contents?: true

Size: 1011 Bytes

Versions: 1

Compression:

Stored size: 1011 Bytes

Contents

module Motr
  class Engine < ::Rails::Engine #:nodoc:
    config.motr = Motr
    
    # Add load paths straight to I18n, so engines and application can overwrite it.
    require 'active_support/i18n'
    I18n.load_path << File.expand_path('../../config/locales/en.yml', __FILE__)
    
    initializer 'motr.initializer' do
      require 'motr/orm/mongoid' if defined?(Mongoid)
      require 'motr/forms'
            
      ActiveSupport.on_load(:action_view) do        
        include Motr::Helpers::LayoutHelpers
        include Motr::Helpers::Navigation
        include Motr::Helpers::Elements
        include Motr::Forms::Helpers
        self.send :default_form_builder=, Motr::Forms.default_builder
      end      
      ActiveSupport.on_load(:action_controller) do
        include Motr::Controller::Helpers
        self.responder = Motr::Controller::Responder
      end
      ActiveSupport.on_load(:active_record) do        
        require 'motr/orm/active_record'
      end
      
    end
    
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
motr-0.0.7 lib/motr/rails.rb