Sha256: 9a4f324075b4094ccfe6abdf99ae5cc85204df2ce0c76a2005e322ef2473af2e

Contents?: true

Size: 887 Bytes

Versions: 9

Compression:

Stored size: 887 Bytes

Contents

require 'rails'
require 'i18n'

module DatePicker
  class Railtie < ::Rails::Railtie
    
    railtie_name :date_picker
    
    # requires all dependencies
    Gem.loaded_specs['date_picker'].dependencies.each do |d|
     require d.name
    end
    
    # application configuration initializer
    config.date_picker = ActiveSupport::OrderedOptions.new # enable namespaced configuration in Rails environments
  
    initializer "date_picker.configure" do |app|
      DatePicker.configure do |config|
        # copy parameters from application configuration
        config.style = app.config.date_picker[:style]
        config.formats = app.config.date_picker[:formats]
      end
    end
   
    initializer "date_picker.view" do
      ActiveSupport.on_load :action_view do
        include DatePicker::FormTagHelper
        include DatePicker::FormHelper
      end
    end
    
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
date_picker-0.0.9 lib/date_picker/railtie.rb
date_picker-0.0.8 lib/date_picker/railtie.rb
date_picker-0.0.7 lib/date_picker/railtie.rb
date_picker-0.0.6 lib/date_picker/railtie.rb
date_picker-0.0.5 lib/date_picker/railtie.rb
date_picker-0.0.4 lib/date_picker/railtie.rb
date_picker-0.0.3 lib/date_picker/railtie.rb
date_picker-0.0.2 lib/date_picker/railtie.rb
date_picker-0.0.1 lib/date_picker/railtie.rb