I have class A.
I have a class B with attributes c and d.
A has many Bs.

I get an instance of A using
a = find_by....

I can get a listing (enumeration) of values for attribute b using map
function.

   a.b.map{ |x| x.c}

c1
c2
c3

However, I want c and d returned and paired together in an array like a
2-d array.

c1  d1
c2  d2
c3  c3

What's the best way to do this?  Map won't work, correct?

-- 
Posted via http://www.ruby-forum.com/.

-- 
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+unsubscr...@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/msgid/rubyonrails-talk/d523e7b0f6a6396078ba06c074e8e9c7%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to