[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Rails: acts_as_list (using acts_as_tree

Rainer Jung

6/27/2006 3:51:00 PM

Hello there!

I have a small problem. I am building an gallery-application with
Rails.
The model for the gallery is using "acts_as_tree" and "has_many
:images".
The image model "belongs_to :gallery" and "acts_as_list :scope =>
:gallery_id".
I intended to use acts_as_list to be able to find all images in the
same gallery-scope to simply paginate the images with ":per_page => 1".
But now if i have the "@image", and try to get all other images, i
would try to do "@image.parent.children". With .parent i would get the
Gallery-instance, but if i use .children on that Gallery-instance, i
probably would get the other Gallery-instances, which are in the
subtree of the image.
Has someone a nice idea how to easily paginate the images from one
gallery?

Regards, Rainer