Sha256: 71d8bb45896aca9267126e14fdf74d9e58648afefc405a876e8a384abea74f6e

Contents?: true

Size: 1.24 KB

Versions: 4

Compression:

Stored size: 1.24 KB

Contents

# frozen_string_literal: true

require "action_controller"
require "rails/railtie"

module ActionController
  autoload :Responder, "action_controller/responder"
  autoload :RespondWith, "action_controller/respond_with"
end

module Responders
  autoload :FlashResponder,      "responders/flash_responder"
  autoload :HttpCacheResponder,  "responders/http_cache_responder"
  autoload :CollectionResponder, "responders/collection_responder"
  autoload :LocationResponder,   "responders/location_responder"

  require "responders/controller_method"

  class Railtie < ::Rails::Railtie
    config.responders = ActiveSupport::OrderedOptions.new
    config.responders.flash_keys = [:notice, :alert]
    config.responders.namespace_lookup = false

    # 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|
      Responders::FlashResponder.flash_keys = app.config.responders.flash_keys
      Responders::FlashResponder.namespace_lookup = app.config.responders.namespace_lookup
    end
  end
end

ActiveSupport.on_load(:action_controller) do
  include ActionController::RespondWith
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
date_n_time_picker_activeadmin-0.1.2 vendor/bundle/ruby/2.6.0/gems/responders-3.0.1/lib/responders.rb
date_n_time_picker_activeadmin-0.1.1 vendor/bundle/ruby/2.6.0/gems/responders-3.0.1/lib/responders.rb
responders-3.0.1 lib/responders.rb
responders-3.0.0 lib/responders.rb