Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Use reverse merge

  • Loading branch information...
commit ab19d711134e1cb39a960079c6df32a4f1e5a5df 1 parent 150b249
@nesquena authored
Showing with 2 additions and 3 deletions.
  1. +2 −3 lib/semantic_fields_renderer.rb
View
5 lib/semantic_fields_renderer.rb
@@ -144,10 +144,9 @@ def self.create_field_element(input_type)
# returns => { :value => 'field_value', :label => "some string", :id => 'some_id', ... }
#
def field_tag_item_options(element_name, input_type, options)
- result_options = (options || { :class => "" }).dup
- result_options[:id] ||= element_name
+ result_options = (options || {}).dup
+ result_options.reverse_merge!(:value => nil, :class => '', :id => element_name)
result_options[:label] ||= element_name.to_s.titleize
- result_options[:value] ||= nil
result_options[:class] << " #{input_type}"
result_options
end

0 comments on commit ab19d71

Please sign in to comment.
Something went wrong with that request. Please try again.