Hi!
I created a table like this:
create_table :work_items do |t|
t.date :execution_date
t.string :section
t.integer :member_id
t.time :duration
t.text :description
t.timestamps
end
I need the duration field to enter something like HH:MM. Just the time
without a date.
When I enter it, everything seems fine… But when I return to the
edit view I see the time formatted like 2000-01-01 10:23:00…
When I create a validate method in the model to check on the input, I
allways get 2000-01-01 10:23:00, weird because I only entered 10:23…
This is the validate method in the model:
]def validate
puts duration # Results in 2000-01-01 10:23:00
end
Can anyone help me? I hoped time would work like date, with this
column I don’t have any problems…
Thhnx!