# Date\_select in a partial

**URL:** <https://www.ruby-forum.com/t/date-select-in-a-partial/126906>\
**Category:** Rails\
**Created:** [January 23, 2008, 11:41am UTC](https://www.ruby-forum.com/t/date-select-in-a-partial/126906 "2008-01-23T11:41:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![donzo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f07891/32.png) [@donzo](https://www.ruby-forum.com/u/donzo)\
**Post date:** [January 23, 2008, 11:41am UTC](https://www.ruby-forum.com/t/date-select-in-a-partial/126906/1 "2008-01-23T11:41:11Z")

</div>

Hello,

Currently I have a date\_select in a form partial. This partial is  
rendered by the edit and new form-actions.

But the problem is that when I go into the new page and save the form  
it automaticly selects the current date. Actually I want that with the  
new action the selected date are empty values (:include\_blank) and  
when Im in the edit form I want him to extract the values from the  
data given (if nil \> show empty entries).

What is the most elegant approach for this?

Kind regards,  
Don P.

---

<div class="post-metadata">

**Author:** ![donzo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f07891/32.png) [@donzo](https://www.ruby-forum.com/u/donzo)\
**Post date:** [January 23, 2008, 11:52am UTC](https://www.ruby-forum.com/t/date-select-in-a-partial/126906/2 "2008-01-23T11:52:27Z")

</div>

if you use form helper date\_select(:object, :attr) then rails should  
pull it out of the object by default as with other form helpers. Could  
you post the code?
