Forum: Ruby on Rails Getting value from time_select

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
3275da7fdbd73cb4e7956fd0d29164de?d=identicon&s=25 Paul Bergstrom (palb)
on 2008-10-08 16:32
When I try to get the value of a time_select into a flash[:notice], just
to check it, I get nil. What ever I try I can't deal with it. It goes
into the db alright as mysql time, so that's fine (e.g. 10:00:00).

Could someone explain what type the params is coming from a time_select?
Is it a time object or string or what?
81b61875e41eaa58887543635d556fca?d=identicon&s=25 Frederick Cheung (Guest)
on 2008-10-08 16:46
(Received via mailing list)
On 8 Oct 2008, at 15:32, Pål Bergström wrote:

>
> When I try to get the value of a time_select into a flash[:notice],
> just
> to check it, I get nil. What ever I try I can't deal with it. It goes
> into the db alright as mysql time, so that's fine (e.g. 10:00:00).
>
> Could someone explain what type the params is coming from a
> time_select?
> Is it a time object or string or what?

Neither. it's a set of three (two if you don't have seconds)
parameters called stuff like start(1i), start(2i). Peek at your logs
to see exactly what the parameters are.

Fred
3275da7fdbd73cb4e7956fd0d29164de?d=identicon&s=25 Paul Bergstrom (palb)
on 2008-10-08 17:04
Frederick Cheung wrote:
> On 8 Oct 2008, at 15:32, P�l Bergstr�m wrote:
>
>>
>> When I try to get the value of a time_select into a flash[:notice],
>> just
>> to check it, I get nil. What ever I try I can't deal with it. It goes
>> into the db alright as mysql time, so that's fine (e.g. 10:00:00).
>>
>> Could someone explain what type the params is coming from a
>> time_select?
>> Is it a time object or string or what?
>
> Neither. it's a set of three (two if you don't have seconds)
> parameters called stuff like start(1i), start(2i). Peek at your logs
> to see exactly what the parameters are.
>
> Fred

Yes I saw that. But when I try params[:calendar][:start_time](4i) it
doesn't work.
81b61875e41eaa58887543635d556fca?d=identicon&s=25 Frederick Cheung (Guest)
on 2008-10-08 17:10
(Received via mailing list)
On 8 Oct 2008, at 16:04, Pål Bergström wrote:

>>>
> Yes I saw that. But when I try params[:calendar][:start_time](4i) it
> doesn't work.

params[:calendar][:'start_time(4i)']

Fred
3275da7fdbd73cb4e7956fd0d29164de?d=identicon&s=25 Paul Bergstrom (palb)
on 2008-10-08 17:35
Frederick Cheung wrote:
> On 8 Oct 2008, at 16:04, Pål Bergström wrote:
>
>>>>
>> Yes I saw that. But when I try params[:calendar][:start_time](4i) it
>> doesn't work.
>
> params[:calendar][:'start_time(4i)']
>
> Fred

Works. Thanks :-)
This topic is locked and can not be replied to.