# Newbie: Want to use time\_select to partial fill a datetime f

**URL:** <https://www.ruby-forum.com/t/newbie-want-to-use-time-select-to-partial-fill-a-datetime-f/111503>\
**Category:** Rails\
**Created:** [August 8, 2007, 1:02am UTC](https://www.ruby-forum.com/t/newbie-want-to-use-time-select-to-partial-fill-a-datetime-f/111503 "2007-08-08T01:02:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jules](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/41988e/32.png) [@jules](https://www.ruby-forum.com/u/jules)\
**Post date:** [August 8, 2007, 1:02am UTC](https://www.ruby-forum.com/t/newbie-want-to-use-time-select-to-partial-fill-a-datetime-f/111503/1 "2007-08-08T01:02:20Z")

</div>

Hello

Our Database schema, and hence Our Model has a few datetime columns/  
fields. But when entering new instances, We only want to present time  
(i.e. HH:MM) in in our HTML views to the user. The time\_select looks  
useful, because it has an attractive minute\_select: =\>15, so the user  
can enter 1/4 hours increments. The idea being that we would default  
the Date part of Datetime attribute to Todays.date, prior to the Save  
in our Model.

The problem is the default RAILS \<%Forms %\> to Active\_record  
constructs, presumes that all the Form Input fields are to map  
directly onto the corresponding DateTime attributes in the model\> This  
results in calendar Day:Month:Year fields being presented, which is  
excessive to the user. We cannot find anu obvious shortcut datetime =\>  
time RHTML mechanisms in the basic RAILS material. Do any exist ?

Without any time columns/fields in the database, and hence the model,  
we cannot make use time\_select in our rhtml views. So I guess the  
only real option is that I go back to raw Form html, for this  
particular reduced time field, name and extract explicitly in my  
controller.  
Is this a common problem ? and typical approach to adopt ?

Cheers

Jules
