Method: SimpleForm::FormBuilder#find_mapping
- Defined in:
- lib/simple_form_extension/ext/form_builder.rb
#find_mapping(input_type) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/simple_form_extension/ext/form_builder.rb', line 7 def find_mapping(input_type) camelized = if (klass = self.class.mappings[input_type]) name = klass.name (name =~ /^SimpleForm::Inputs/) ? name.split("::").last : name else "#{ input_type.to_s.camelize }Input" end mapping = attempt_mapping(camelized, SimpleFormExtension::Inputs) return (discovery_cache[input_type] = mapping) if mapping _original_find_mapping(input_type) end |