# Select\_date method

**URL:** <https://www.ruby-forum.com/t/select-date-method/78772>\
**Category:** Rails\
**Created:** [December 8, 2006, 1:50pm UTC](https://www.ruby-forum.com/t/select-date-method/78772 "2006-12-08T13:50:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![vasan\_cec](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/258eb7/32.png) [@vasan\_cec](https://www.ruby-forum.com/u/vasan_cec)\
**Post date:** [December 8, 2006, 1:50pm UTC](https://www.ruby-forum.com/t/select-date-method/78772/1 "2006-12-08T13:50:54Z")

</div>

Hi Everyone,  
I used “select\_date” method in my application and got 3 select boxes  
for Date, Month and Year.  
Code :

\<%= text\_field ‘content’, ‘title’ %\>  
\<%= text\_field ‘content’, ‘description’ %\>  
\<%= select\_date %\>  
Now, i want to update it to my database with column name “startDt”.  
but i unable to do it. I am unable to name those select boxes.  
Can anyone help with this…

Thanks in advance  
Regards,  
Vasanth

---

<div class="post-metadata">

**Author:** ![vasan\_cec](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/258eb7/32.png) [@vasan\_cec](https://www.ruby-forum.com/u/vasan_cec)\
**Post date:** [December 8, 2006, 2:07pm UTC](https://www.ruby-forum.com/t/select-date-method/78772/2 "2006-12-08T14:07:23Z")

</div>

use this for select-date ‘content’, ‘startDt’  
and use start\_form\_tag :action=\>“xyz”  
and end\_form\_tag

i got only this, if u are not expecting this please explain in clear…  
Vasanthakumar C. wrote:

> Hi Everyone,  
> I used “select\_date” method in my application and got 3 select boxes  
> for Date, Month and Year.  
> Code :
> 
> \<%= text\_field ‘content’, ‘title’ %\>  
> \<%= text\_field ‘content’, ‘description’ %\>  
> \<%= select\_date %\>  
> Now, i want to update it to my database with column name “startDt”.  
> but i unable to do it. I am unable to name those select boxes.  
> Can anyone help with this…
> 
> Thanks in advance  
> Regards,  
> Vasanth

---

<div class="post-metadata">

**Author:** ![vasan\_cec](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/258eb7/32.png) [@vasan\_cec](https://www.ruby-forum.com/u/vasan_cec)\
**Post date:** [December 8, 2006, 2:14pm UTC](https://www.ruby-forum.com/t/select-date-method/78772/3 "2006-12-08T14:14:09Z")

</div>

Hi,  
Thanks for ur help. But problem is not solved.

Actually i can insert or update (without select\_date field), but the  
requirement is : i should get a date + month + year from user and store  
it in database (column name “startDt” type “DateTime”)

Still, i did as u told but got this error  
“undefined method `year’ for “content”:String”

Please help me out…

---

<div class="post-metadata">

**Author:** ![vasan\_cec](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/258eb7/32.png) [@vasan\_cec](https://www.ruby-forum.com/u/vasan_cec)\
**Post date:** [December 8, 2006, 2:29pm UTC](https://www.ruby-forum.com/t/select-date-method/78772/4 "2006-12-08T14:29:48Z")

</div>

try this,  
\<%= start\_form\_tag :action =\> ‘xyz’ %\>  
\<%= datetime\_select ‘content’, ‘StartDt’ %\>  
\<%= submit\_tag “Create” %\>  
\<%= end\_form\_tag %\>

Vasanthakumar C. wrote:

> Hi,  
> Thanks for ur help. But problem is not solved.
> 
> Actually i can insert or update (without select\_date field), but the  
> requirement is : i should get a date + month + year from user and store  
> it in database (column name “startDt” type “DateTime”)
> 
> Still, i did as u told but got this error  
> “undefined method `year’ for “content”:String”
> 
> Please help me out…

---

<div class="post-metadata">

**Author:** ![vasan\_cec](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/258eb7/32.png) [@vasan\_cec](https://www.ruby-forum.com/u/vasan_cec)\
**Post date:** [December 8, 2006, 2:46pm UTC](https://www.ruby-forum.com/t/select-date-method/78772/5 "2006-12-08T14:46:23Z")

</div>

Yes it worked out… 🙂  
Thanks a lot.  
Bye
