You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a form contains a <select> with no <option> elements, submitting the form yields a corresponding key-value pair with a string literal 'null' value. Non-empty selects and empty non-select elements yield the empty string.
Example:
form do
select name: :select1 do
label 'Select1'
# first item selected by default:
some_array.each_with_index do |item, i|
option text: item, value: i
end
end
select name: :select2 do
label 'Select2'
# no options:
[].each_with_index do |item, i|
option text: item, value: i
end
end
button 'Submit' do
creates some_path, redirect: some_other_path
end
end
Submitting the above form yields:
select1: 0
select2: "null"
The text was updated successfully, but these errors were encountered:
If a form contains a
<select>
with no<option>
elements, submitting the form yields a corresponding key-value pair with a string literal'null'
value. Non-empty selects and empty non-select elements yield the empty string.Example:
Submitting the above form yields:
The text was updated successfully, but these errors were encountered: