# Form date helper with text year

**URL:** <https://www.ruby-forum.com/t/form-date-helper-with-text-year/192221>\
**Category:** Rails\
**Created:** [July 26, 2010, 4:25pm UTC](https://www.ruby-forum.com/t/form-date-helper-with-text-year/192221 "2010-07-26T16:25:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AppleII717](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/59ef9b/32.png) [@AppleII717](https://www.ruby-forum.com/u/AppleII717)\
**Post date:** [July 26, 2010, 4:25pm UTC](https://www.ruby-forum.com/t/form-date-helper-with-text-year/192221/1 "2010-07-26T16:25:12Z")

</div>

I have a date where the year range is more then I want to define in a  
select\_date scaffold generated year range.

My idea was to have the year entered as a text field and the month and  
day using something like:

\<%= select\_month @person.born,:prefix =\> :person ,:field\_name =\>  
“born(2i)” %\>  
\<%= select\_day @person.born,:prefix =\> :person , :field\_name =\>  
“born(3i)” %\>

\<%= f.text\_field ??? or text\_field\_tag ??? field\_name =\>  
“born(1i)” %\>

I just can’t seem to find the set of options to build the year tag.  
Guess I also would have to extract the year out of the date for the  
value.

Can’t seem to find any examples and looking for help.

---

<div class="post-metadata">

**Author:** ![AppleII717](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/59ef9b/32.png) [@AppleII717](https://www.ruby-forum.com/u/AppleII717)\
**Post date:** [July 26, 2010, 6:10pm UTC](https://www.ruby-forum.com/t/form-date-helper-with-text-year/192221/2 "2010-07-26T18:10:36Z")

</div>

I’ll answer my own question:

```
    <%= select_month @person.born,:prefix => :person ,:field_name

```

=\> “born(2i)” %\>  
\<%= select\_day @person.born,:prefix =\> :person , :field\_name  
=\> “born(3i)” %\>  
\<%= text\_field\_tag “person[born(1i)]”, value =  
@person.born.year,:size =\> 4 %\>
