# Date\_select with 2i and 1i getting mashed

**URL:** <https://www.ruby-forum.com/t/date-select-with-2i-and-1i-getting-mashed/119284>\
**Category:** Rails\
**Created:** [November 5, 2007, 8:01pm UTC](https://www.ruby-forum.com/t/date-select-with-2i-and-1i-getting-mashed/119284 "2007-11-05T20:01:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sgudibanda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a9adbd/32.png) [@sgudibanda](https://www.ruby-forum.com/u/sgudibanda)\
**Post date:** [November 5, 2007, 8:01pm UTC](https://www.ruby-forum.com/t/date-select-with-2i-and-1i-getting-mashed/119284/1 "2007-11-05T20:01:39Z")

</div>

Hi,

I have this in my view,

\<%= date\_select(‘Case’, ‘date\_from’,  
:end\_year =\> 1990, :start\_year =\>Date.today.year,  
:discard\_day =\> true,  
:include\_blank =\> true,  
:order =\> [:month, :year])%\>

if only month is chosen and not year, then i have problems reloading it.  
Lets say i chose July as month and leave year empty.

When I render the new again (say for an active record error), year will  
be 2007 (please note that 7 is taken from july . I it take 2005 for May)  
and month is shown as January.

Any idea how to solve this?

Regards.  
Sandeep G
