From c57d58e07ccd9a0437cf5e0c1472bd70f7a39105 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A5l=20Simen=20Ellingsen?= Date: Tue, 12 Sep 2023 10:44:37 +0200 Subject: [PATCH] Added required class to text input label --- .gitignore | 5 +---- build.gradle | 2 +- src/main/resources/ruby/form_helper.rb | 6 ++++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 30c8d93..8121aa3 100644 --- a/.gitignore +++ b/.gitignore @@ -6,10 +6,7 @@ build/ gradle.properties ### IntelliJ IDEA ### -.idea/modules.xml -.idea/jarRepositories.xml -.idea/compiler.xml -.idea/libraries/ +.idea/ *.iws *.iml *.ipr diff --git a/build.gradle b/build.gradle index e7f4748..509c4b5 100644 --- a/build.gradle +++ b/build.gradle @@ -7,7 +7,7 @@ plugins { } group 'no.datek' -version '0.6.2' +version '0.6.3' final String JRUBY_VERSION = '9.4.3.0'; repositories { diff --git a/src/main/resources/ruby/form_helper.rb b/src/main/resources/ruby/form_helper.rb index 9fde66b..21990ca 100644 --- a/src/main/resources/ruby/form_helper.rb +++ b/src/main/resources/ruby/form_helper.rb @@ -117,6 +117,7 @@ def text_input(object, field_name, **opts) id_name = opts.delete(:id) || field_name.to_s.gsub('.', '_') disabled = opts.delete(:disabled) readonly = opts.delete(:readonly) + required = opts.delete(:required) type = opts.delete(:type) || 'text' value = opts.delete(:value) placeholder = opts.delete(:placeholder) @@ -124,7 +125,7 @@ def text_input(object, field_name, **opts) html = "" field_value = value || object_field_value(object, field_name) html << %{#{label} } end