Sha256: 6c885a8161eeb52a8febcecf0415817e07617a9db84eb2be8fcb3549538386e7

Contents?: true

Size: 950 Bytes

Versions: 11

Compression:

Stored size: 950 Bytes

Contents

# frozen_string_literal: true

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

11 entries across 11 versions & 1 rubygems

Version Path
rails-uploader-0.5.9 lib/uploader/engine.rb
rails-uploader-0.5.8 lib/uploader/engine.rb
rails-uploader-0.5.7 lib/uploader/engine.rb
rails-uploader-0.5.6 lib/uploader/engine.rb
rails-uploader-0.5.5 lib/uploader/engine.rb
rails-uploader-0.5.4 lib/uploader/engine.rb
rails-uploader-0.5.3 lib/uploader/engine.rb
rails-uploader-0.5.2 lib/uploader/engine.rb
rails-uploader-0.5.1 lib/uploader/engine.rb
rails-uploader-0.5.0 lib/uploader/engine.rb
rails-uploader-0.4.5 lib/uploader/engine.rb