# Select\_time help needed (Noob)

**URL:** <https://www.ruby-forum.com/t/select-time-help-needed-noob/54678>\
**Category:** Rails\
**Created:** [March 12, 2006, 5:55pm UTC](https://www.ruby-forum.com/t/select-time-help-needed-noob/54678 "2006-03-12T17:55:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![stuartbrand](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/5f9b8f/32.png) [@stuartbrand](https://www.ruby-forum.com/u/stuartbrand)\
**Post date:** [March 12, 2006, 5:55pm UTC](https://www.ruby-forum.com/t/select-time-help-needed-noob/54678/1 "2006-03-12T17:55:06Z")

</div>

I can’t seem to get a handle on how the select\_time helper is supposed  
to work. I’m a complete noob to rails so bear with me please. I’m trying  
to add fields to a form to allow for time (hh:mm) selection ie. call  
received, enroute, etc… I don’t understand how one maps the form data  
to the table object and field ie. calls table recieved field.  
(calls.recieved) The field is of type MySQL TIME. The API offers  
“select\_time(datetime = Time.now, options = {})” as the only  
documentation for this helper. This doesn’t help me much. I’ve spent  
several hours searching for answers but no joy.

Thanks

---

<div class="post-metadata">

**Author:** ![stuartbrand](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/5f9b8f/32.png) [@stuartbrand](https://www.ruby-forum.com/u/stuartbrand)\
**Post date:** [March 12, 2006, 6:45pm UTC](https://www.ruby-forum.com/t/select-time-help-needed-noob/54678/2 "2006-03-12T18:45:19Z")

</div>

On Sunday 12 Mar 2006 16:55, Stuart B. wrote:

> I can’t seem to get a handle on how the select\_time helper is supposed  
> to work. I’m a complete noob to rails so bear with me please. I’m trying  
> to add fields to a form to allow for time (hh:mm) selection ie. call  
> received, enroute, etc… I don’t understand how one maps the form data  
> to the table object and field ie. calls table recieved field.  
> (calls.recieved) The field is of type MySQL TIME. The API offers  
> “select\_time(datetime = Time.now, options = {})” as the only  
> documentation for this helper. This doesn’t help me much. I’ve spent  
> several hours searching for answers but no joy.

I was going to try and help you out with a way of doing this, but it  
seems  
it’s not easily possible using current Gem Rails - since the command you  
need  
is “time\_select” not “select\_time”.

## “Select\_something” helpers give you just the raw selection boxes, whereas “Something\_select” helpers supply them pre-selected for accessing a specified attribute on an object. At the moment, there isn’t a time\_select helper

however, a patch on the following page should do what you need:

[http://dev.rubyonrails.org/ticket/3811](http://dev.rubyonrails.org/ticket/3811)

I think you need just the last one:

[http://dev.rubyonrails.org/attachment/ticket/3811/date\_helper\_mega\_patch3.diff?format=txt](http://dev.rubyonrails.org/attachment/ticket/3811/date_helper_mega_patch3.diff?format=txt)

If you’ve never worked with .diff patch files before, here’s a general  
howto:

[http://www.linux.com/article.pl?sid=06/02/16/1938203](http://www.linux.com/article.pl?sid=06/02/16/1938203)

All Linux distros and I’m guessing OSX too have the patch tool as  
standard.  
If you’re on Windows, you probably need this:

> **[Patch for Windows](https://gnuwin32.sourceforge.net/packages/patch.htm)**
>
> patch {whatisit}

I haven’t actually ever patched my own Rails install, but it shouldn’t  
be  
particularly difficult.

An easier way of getting this might be to run Edge Rails, but again,  
this  
isn’t something I’ve done myself. Still, looks pretty simple -  
instructions  
here:

[http://wiki.rubyonrails.com/rails/pages/EdgeRails](http://wiki.rubyonrails.com/rails/pages/EdgeRails)

Hope that helps!

~Dave

–

Dave S.  
Rent-A-Monkey Website Development

> **[Tree Removal Service For Home & Businesses in Salt Lake City, UT](https://www.rentamonkey.com/)**
>
> Rent A Monkey Tree Service provides the safest, highest-quality tree removal for Salt Lake City, UT homes and businesses. Request a service today!

PGP Key: [http://www.rentamonkey.com/pgpkey.asc](http://www.rentamonkey.com/pgpkey.asc)

---

<div class="post-metadata">

**Author:** ![stuartbrand](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/5f9b8f/32.png) [@stuartbrand](https://www.ruby-forum.com/u/stuartbrand)\
**Post date:** [March 13, 2006, 7:54pm UTC](https://www.ruby-forum.com/t/select-time-help-needed-noob/54678/3 "2006-03-13T19:54:10Z")

</div>

## Thank you very much for the information. I eventually learned that I would need to either run edge rails or apply the patch. I have not done either before so I appreciate the links. Wish me luck and thank you again.

View this message in context:  
[http://www.nabble.com/select\_time-help-needed-(Noob)-t1268227.html#a3383306](http://www.nabble.com/select_time-help-needed-%28Noob%29-t1268227.html#a3383306)  
Sent from the RubyOnRails Users forum at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![stuartbrand](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/5f9b8f/32.png) [@stuartbrand](https://www.ruby-forum.com/u/stuartbrand)\
**Post date:** [March 13, 2006, 9:13pm UTC](https://www.ruby-forum.com/t/select-time-help-needed-noob/54678/4 "2006-03-13T21:13:40Z")

</div>

I read the information on the pages you suggested and thought, “this  
won’t be  
too bad”. I downloaded the patch and tried to figure out what to patch.  
Can  
someone tell me which file I’m trying to patch? I’m assuming that I need  
to  
patch the corresponding file under gems. If so, I’ll need to change the  
relative paths in the patch right? The patch is pointing to  
actionpack/test/template/active\_record\_helper\_test.rb and I don’t have  
an  
actionpack directory. I do have 2 versioned directories with the most  
recent  
being actionpack-1.11.2. I looked everywhere and I can’t find a good  
reference on patching rails.

## Can someone point me in the right direction?

View this message in context:  
[http://www.nabble.com/select\_time-help-needed-(Noob)-t1268227.html#a3384661](http://www.nabble.com/select_time-help-needed-%28Noob%29-t1268227.html#a3384661)  
Sent from the RubyOnRails Users forum at [Nabble.com](http://Nabble.com).
