From c59fe9fe714baaeea17784458afd9062c721649b Mon Sep 17 00:00:00 2001 From: Patri Date: Fri, 30 May 2014 01:08:40 +0200 Subject: [PATCH] date_of_birth in views new and edit --- app/views/users/_form.html.haml | 2 +- app/views/users/show.html.haml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/users/_form.html.haml b/app/views/users/_form.html.haml index 132af5c..d8ca3fe 100644 --- a/app/views/users/_form.html.haml +++ b/app/views/users/_form.html.haml @@ -17,7 +17,7 @@ = f.input :phone = f.input :alt_phone - + = f.input :date_of_birth, start_year: Date.today.year - 90, end_year: Date.today.year - 12, include_blank: :true / = f.association :categories, label_method: :fqn, input_html: {style: 'width: 100%'} .form-actions diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml index 8ab82e9..f2475e4 100644 --- a/app/views/users/show.html.haml +++ b/app/views/users/show.html.haml @@ -35,7 +35,7 @@ %dl.dl-horizontal - - if @user.date_of_birth.present? + - if @user.date_of_birth.present? && admin? %dt= User.human_attribute_name(:date_of_birth) %dd= l @user.date_of_birth - phones = [@user.phone, @user.alt_phone].map(&:presence).compact