From d47950733d9022f1f3e8a30178cc8bc44ea846b9 Mon Sep 17 00:00:00 2001 From: Faizaan Gagan Date: Mon, 5 Jul 2021 11:52:29 +0530 Subject: [PATCH] enabled interpolation and templating --- lib/custom_wizard/builder.rb | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/custom_wizard/builder.rb b/lib/custom_wizard/builder.rb index da10a100..fab99446 100644 --- a/lib/custom_wizard/builder.rb +++ b/lib/custom_wizard/builder.rb @@ -86,7 +86,7 @@ class CustomWizard::Builder required: field_template['required'] } - %w(label description image key validations min_length max_length char_counter placeholder).each do |key| + %w(label description image key validations min_length max_length char_counter).each do |key| params[key.to_sym] = field_template[key] if field_template[key] end @@ -187,6 +187,16 @@ class CustomWizard::Builder ) end + if field_template['placeholder'].present? + params[:placeholder] = mapper.interpolate( + field_template['placeholder'], + user: true, + value: true, + wizard: true, + template: true + ) + end + field = step.add_field(params) end