Commit 9584f748 authored by Birger Schacht's avatar Birger Schacht Committed by o
Browse files

Don't display a select box if there is only one option to choose from

... instead display a readonly text field
parent 299d62f5
Pipeline #8189 failed with stages
......@@ -41,7 +41,11 @@ allowed = [q['max'].to_i - q['cur'].to_i, 0].max
<% end %>
<%= case v
when Array
select_tag('data_'+n, options_for_select(v), class: 'form-control')
if v.length == 1
text_field_tag('data_'+n, v, class: 'form-control', readonly: true)
else
select_tag('data_'+n, options_for_select(v), class: 'form-control')
end
else
text_field_tag('data_'+n, "", class: 'form-control')
end %>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment