From 346761d164b6a57bfc0e36f8550fe3b7b36ae26c Mon Sep 17 00:00:00 2001 From: f Date: Fri, 14 Dec 2018 11:17:34 -0300 Subject: [PATCH] =?UTF-8?q?los=20campos=20de=20a=C3=B1o=20tienen=20un=20li?= =?UTF-8?q?stado=20de=20a=C3=B1os=20posibles?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/posts/template_field/_year.haml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/views/posts/template_field/_year.haml b/app/views/posts/template_field/_year.haml index dba6e22d..f6f28656 100644 --- a/app/views/posts/template_field/_year.haml +++ b/app/views/posts/template_field/_year.haml @@ -1,4 +1,11 @@ = number_field_tag field_name_for_post_as_string(name), value, class: 'form-control', - required: template.required? + required: template.required?, + list: "#{name}_years", + min: template.min, + max: Date.today.year + +%datalist{id: "#{name}_years"} + - (template.min..Date.today.year).to_a.each do |y| + %option{value: y}