Skip to content

Commit

Permalink
Fixed handling of selected option for a select field.
Browse files Browse the repository at this point in the history
  • Loading branch information
UweKubosch committed Feb 26, 2024
1 parent e0efd71 commit 3603357
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {
}

group 'no.datek'
version '0.13.2'
version '0.13.3'
final String JRUBY_VERSION = '9.4.5.0';

repositories {
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/ruby/form_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,9 @@ def select_input(object, field_name, option_map = [], **opts)
end
html << ">"

field_value = selected || object_field_value(object, field_name)
field_value = selected&.to_s&.strip || object_field_value(object, field_name)

if field_value.empty? && prompt
if field_value.blank? && prompt
html << %{<option value="">#{TrueClass === prompt ? "(#{message['text.none']})" : CGI.escapeHTML(prompt.to_s)}</option>}
end

Expand Down

0 comments on commit 3603357

Please sign in to comment.