diff --git a/build.gradle b/build.gradle index b526801..2b1f8ec 100644 --- a/build.gradle +++ b/build.gradle @@ -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 { diff --git a/src/main/resources/ruby/form_helper.rb b/src/main/resources/ruby/form_helper.rb index 5a931ad..a85164c 100644 --- a/src/main/resources/ruby/form_helper.rb +++ b/src/main/resources/ruby/form_helper.rb @@ -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 << %{} end