Well, I found a solution to my second problem. I'll post it here for archival purposes. I am storing two things in my database:
start_time with data type Time
end_time with data type Time
I wanted to use 2 select boxes: one for start_time and one for end_time. The time values were in a specific format within a specific range. The times were in the format '%I:%M %p' from 6:00am - 8:00pm. So I created a private method within my controller that generated an array that looked like this:
[
[6:00 AM, Time.parse('2000-01-01 6:00:00 AM')],
[6:30 AM, Time.parse('2000-01-01 6:30:00 AM')],
[7:00 AM, Time.parse('2000-01-01 7:00:00 AM')]
etc.
]
So the display value in the select box would be '6:00 AM' and the select value is something like 'Sat Jan 01 6:30:00 -0700 2000'. The thing that caught me was that the Time data type in MySQL doesn't return just a time in the format '%I:%M %p'... it instead returns a default date as well as the time. The only way to make something populate the time select box properly was to tack on the date as well to the value.
If anyone has a better way to do this, I would love to hear it.
Last edited by Ceres (2007-01-21 20:30:03)