Files

Class/Module Index [+]

Quicksearch

SimpleForm::MapType

Public Instance Methods

map_type(*types) click to toggle source
# File lib/simple_form/map_type.rb, line 10
def map_type(*types)
  map_to = types.extract_options![:to]
  raise ArgumentError, "You need to give :to as option to map_type" unless map_to
  self.mappings = mappings.merge types.each_with_object({}) { |t, m| m[t] = map_to }
end

Public Class Methods

extended(base) click to toggle source
# File lib/simple_form/map_type.rb, line 5
def self.extended(base)
  base.class_attribute :mappings
  base.mappings = {}
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.