Fix SimpleForm bug when passing :name => nil as a options.
Since
f0a5d32537
if you pass :name => nil to an input it will not generate the automatic
name.
This issue was hidden because country_select has reimplemented
add_default_name_and_id on ActionView::Helpers::Tags::Base.
This commit is contained in:
parent
3f185afa09
commit
f991c8dd72
|
@ -49,9 +49,10 @@ module SimpleForm
|
||||||
# we need the hidden field to be *outside* the label (otherwise it
|
# we need the hidden field to be *outside* the label (otherwise it
|
||||||
# generates invalid html - html5 only).
|
# generates invalid html - html5 only).
|
||||||
def build_hidden_field_for_checkbox
|
def build_hidden_field_for_checkbox
|
||||||
@builder.hidden_field(attribute_name, :value => unchecked_value, :id => nil,
|
options = { value: unchecked_value, id: nil, disabled: input_html_options[:disabled] }
|
||||||
:disabled => input_html_options[:disabled],
|
options[:name] = input_html_options[:name] if input_html_options.has_key?(:name)
|
||||||
:name => input_html_options[:name])
|
|
||||||
|
@builder.hidden_field(attribute_name, options)
|
||||||
end
|
end
|
||||||
|
|
||||||
def inline_label
|
def inline_label
|
||||||
|
|
Loading…
Reference in New Issue