you have essentially the Array version of a ruby hash.
so you could transform it to a hash and iterate over the keys and values
h['car'] = [['title', 'something1'], ['title2','something2']]
=> [["title", "something1"], ["title2", "something2"]]
a = h['car'].to_h
=> {"title"=>"something1", "title2"=>"something2"}
2.3.0 :022 > a.each {|key, value| puts key; puts value}
title
something1
title2
something2
=> {"title"=>"something1", "title2"=>"something2"}
On Tuesday, February 2, 2016 at 6:27:51 AM UTC-6, Torsten Schrör wrote:
>
> Hello,
>
> i have the following problem.
> i try to build dynamical tables on haml with an set of fields in an array.
>
> this meens i have the array
> h['car']=Array[Array['title',fieldname'], Array['title2',fieldname2']]
>
>
> i the haml i am able to do an
>
> cars.each do |c|
> #{c.fieldname}
> #{c.fieldname2}
>
>
> but i am not able to address this fields by reading the arry for the
> possible fields
>
>
> can everyone help?
>
>
> thanks
> torsten
>
>
--
You received this message because you are subscribed to the Google Groups
"Haml" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/haml.
For more options, visit https://groups.google.com/d/optout.