# Format date input on active scaffold form

**URL:** <https://www.ruby-forum.com/t/format-date-input-on-active-scaffold-form/138594>\
**Category:** Rails\
**Created:** [May 25, 2008, 1:17pm UTC](https://www.ruby-forum.com/t/format-date-input-on-active-scaffold-form/138594 "2008-05-25T13:17:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![david](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/aeb1de/32.png) [@david](https://www.ruby-forum.com/u/david)\
**Post date:** [May 25, 2008, 1:17pm UTC](https://www.ruby-forum.com/t/format-date-input-on-active-scaffold-form/138594/1 "2008-05-25T13:17:16Z")

</div>

Hi,

Being new to RoR, I have had difficulty finding information regarding  
date formats for active scaffold. I have a DATE field on the create  
form of one of my controllers. For this specific controller, I would  
like to capture the year only (i.e. %Y). I have already created a  
helper to display the %Y date on the view, but I cannot figure out how  
to do a similar change to the form to only request the user for the  
year.

Any thoughts on how this can be done?

---

<div class="post-metadata">

**Author:** ![david](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/aeb1de/32.png) [@david](https://www.ruby-forum.com/u/david)\
**Post date:** [July 9, 2008, 6:14pm UTC](https://www.ruby-forum.com/t/format-date-input-on-active-scaffold-form/138594/2 "2008-07-09T18:14:09Z")

</div>

David wrote:

> Hi,
> 
> Being new to RoR, I have had difficulty finding information regarding  
> date formats for active scaffold. I have a DATE field on the create  
> form of one of my controllers. For this specific controller, I would  
> like to capture the year only (i.e. %Y). I have already created a  
> helper to display the %Y date on the view, but I cannot figure out how  
> to do a similar change to the form to only request the user for the  
> year.
> 
> Any thoughts on how this can be done?

You have to customize the field either in helper or in view. That is  
also called form/field overrides. See  
[http://activescaffold.com/docs/form-overrides](http://activescaffold.com/docs/form-overrides) and  
[http://activescaffold.com/docs/field-overrides](http://activescaffold.com/docs/field-overrides) for help.
