Skip to content

Commit

Permalink
Auto refresh of switching report.
Browse files Browse the repository at this point in the history
  • Loading branch information
UweKubosch committed Jan 6, 2024
1 parent 143e76a commit 6c55e94
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/main/resources/ruby/form_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 << '<span>' if appendix
Expand All @@ -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 << %{<option value="">}
if field_value.empty?
html << %{#{TrueClass === prompt ? '' : CGI.escapeHTML(prompt.to_s)}</option>}
else
html << "(#{message['text.none']})"
end
html << "</option>"
if field_value.empty? && prompt
html << %{<option value="">#{TrueClass === prompt ? '' : CGI.escapeHTML(prompt.to_s)}</option>}
end

selected_values = multiple ? field_value.split(',') : [field_value]
Expand Down

0 comments on commit 6c55e94

Please sign in to comment.