Sha256: bb028350a31159ff279c44dde6ce19928dd0814b2a806e17387af06f2a8e1660

Contents?: true

Size: 919 Bytes

Versions: 5

Compression:

Stored size: 919 Bytes

Contents

require 'rails'

module Uploader
  # Usage (config/routes.rb):
  #
  #   Rails.application.routes.draw do
  #     mount Uploader::Engine => '/uploader'
  #   end
  #
  class Engine < ::Rails::Engine
    isolate_namespace Uploader

    initializer 'uploader.assets_precompile' do |app|
      app.config.assets.precompile += Uploader.assets
    end

    initializer 'uploader.helpers' do
      ActiveSupport.on_load :action_view do
        ActionView::Base.send(:include, Uploader::Helpers::FormTagHelper)
        ActionView::Helpers::FormBuilder.send(:include, Uploader::Helpers::FormBuilder)
      end
    end

    initializer 'uploader.hooks' do
      require 'uploader/hooks/active_record' if Object.const_defined?('ActiveRecord')
      require 'uploader/hooks/simple_form'   if Object.const_defined?('SimpleForm')
      require 'uploader/hooks/formtastic'    if Object.const_defined?('Formtastic')
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rails-uploader-0.4.4 lib/uploader/engine.rb
rails-uploader-0.4.3 lib/uploader/engine.rb
rails-uploader-0.4.2 lib/uploader/engine.rb
rails-uploader-0.4.1 lib/uploader/engine.rb
rails-uploader-0.4.0 lib/uploader/engine.rb