Jules
2007-Aug-07 23:01 UTC
Newbie: Want to use time_select to partial fill a datetime field
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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---