Ruby on Rails Wednesday, February 27, 2013

Am 27.02.2013 um 16:05 schrieb Colin Law <clanlaw@googlemail.com>:

> On 27 February 2013 12:23, Werner <webagentur.laude@googlemail.com> wrote:
>> Hi
>> I have an attribute decimal => hour
>>
>> If I do
>>
>> hours.each do |h|
>> h.my_hour
>> end
>> I get => 20.0 0.0 0.0 10.0
>>
>> And this..
>> myhour = []
>> hours.each do |h|
>> myhour << hour
>
> That should be
> myhour << h.myhour
> though myhour is a very poor name for an array. It should be plural.
>
>> end
>> myhour.join(",")
>>
>> I get =>
>> <Hour:0x007f81feec3330>,#<Hour:0x007f81feaa0c30>,
>
> That it because you are adding Hour objects into the array, not decimal objects.

o.k..
true..

Thanks

>
> Colin
>
>>
>> How do I get something like this ?
>> 20.0, 0.0, 0.0, 10.0
>>
>> Thanks for support
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Ruby on Rails: Talk" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to rubyonrails-talk+unsubscribe@googlegroups.com.
>> To post to this group, send email to rubyonrails-talk@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msg/rubyonrails-talk/-/6DIGUJ7JlhoJ.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>
> --
> You received this message because you are subscribed to a topic in the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/rubyonrails-talk/4Jd-ZJHdzAo/unsubscribe?hl=en-US.
> To unsubscribe from this group and all its topics, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment