Sha256: a2e39291e15815ec88c7229e86ad5e4c93e651169edcc9b82b52d01b1b313096

Contents?: true

Size: 992 Bytes

Versions: 5

Compression:

Stored size: 992 Bytes

Contents

require 'action_controller/base'

module Responders
  autoload :FlashResponder,      'responders/flash_responder'
  autoload :HttpCacheResponder,  'responders/http_cache_responder'
  autoload :CollectionResponder, 'responders/collection_responder'

  require 'responders/controller_method'

  class Railtie < ::Rails::Railtie
    config.responders = ActiveSupport::OrderedOptions.new
    if config.respond_to?(:app_generators)
      config.app_generators.scaffold_controller = :responders_controller
    else
      config.generators.scaffold_controller = :responders_controller
    end

    # Add load paths straight to I18n, so engines and application can overwrite it.
    require 'active_support/i18n'
    I18n.load_path << File.expand_path('../responders/locales/en.yml', __FILE__)

    initializer "responders.flash_responder" do |app|
      if app.config.responders.flash_keys
        Responders::FlashResponder.flash_keys = app.config.responders.flash_keys
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
responders-0.8.0 lib/responders.rb
responders-0.7.0 lib/responders.rb
responders-0.6.5 lib/responders.rb
responders-0.6.4 lib/responders.rb
responders-0.6.3 lib/responders.rb