diff --git a/src/main/resources/ruby/form_helper.rb b/src/main/resources/ruby/form_helper.rb index 7338396..f2ab024 100644 --- a/src/main/resources/ruby/form_helper.rb +++ b/src/main/resources/ruby/form_helper.rb @@ -253,6 +253,7 @@ def select_input(object, field_name, option_map = [], **opts) disabled = opts.delete(:disabled) multiple = opts.delete(:multiple) ondblclick = opts.delete(:ondblclick) + selected = opts.delete(:selected) html = +'' html << '' if appendix @@ -267,16 +268,10 @@ def select_input(object, field_name, option_map = [], **opts) end html << ">" - field_value = object_field_value(object, field_name) + field_value = selected || object_field_value(object, field_name) - if prompt - html << %{} - else - html << "(#{message['text.none']})" - end - html << "" + if field_value.empty? && prompt + html << %{} end selected_values = multiple ? field_value.split(',') : [field_value]