Colin Law wrote in post #1065311: > On 20 June 2012 09:32, Timen E. <[email protected]> wrote: >> card from my cardlevel array, but i can't seem to access it like this. I >> can however loop it in a seperate each, but i don't want that obviously. > > You have not explained well what you are trying to do, but possibly > you want to loop through the cardlevels instead of the cards, then for > each cardlevel you can obtain the card aswell as the other data, so > something like > > <% @user.cardlevels.each do |cl| %> > <%= cl.card.name %><br> > <%= cl.other_data %> > <% end %> > > You might need to check for cl.card nil though. > > Colin
You're my savior, thanks alot! It's more the train of thought that needs correcting than my code i guess. -- 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 post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

