I think your best option would to make a helper for it. Make one helper
that accepts the entire array and breaks it up into chunks of three, which
passes it to another helper that actually displays the 3 images for you.
If the problem is getting the actual data out, array has a method called
collect which can be used to call the same method on multiple objects in an
array, so you could do something like @users.collect{|user|
user.thumbnail_url} That will give you an array of all of their image urls.
On 7/31/06, Nathan P. Verni <nverni@blenderbox.com>
wrote:>
> I remember reading something awhile back about an easy way to work with
> object arrays in views. Say I want to arrange 20 images objects in rows of
> 3. I have a collection of @users, where each user has a
> user.thumbnail_url image. Is there some way to split these up so that
> they can be easily parsed in rows of three?
>
>
>
>
>
> Thanks,
>
> Nathan
>
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
>
>
--
Mike Weber
Web Developer
UW-Eau Claire
webermp@uwec.edu
715.864.3421
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://wrath.rubyonrails.org/pipermail/rails/attachments/20060731/a3c3efbc/attachment.html