register_detail(name, options = {}, &block) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File actionview/lib/action_view/lookup_context.rb, line 22
    def self.register_detail(name, options = {}, &block)
      self.registered_details << name
      initialize = registered_details.map { |n| "@details[:#{n}] = details[:#{n}] || default_#{n}" }

      Accessors.send :define_method, :"default_#{name}", &block
      Accessors.module_eval         def #{name}          @details.fetch(:#{name}, [])        end        def #{name}=(value)          value = value.present? ? Array(value) : default_#{name}          _set_detail(:#{name}, value) if value != @details[:#{name}]        end        remove_possible_method :initialize_details        def initialize_details(details)          #{initialize.join("\n")}        end, __FILE__, __LINE__ + 1
    end
Register or log in to add new notes.