the problem is that it is listing every site, not just those belonging to group
anyone know what i can do about this ?
I hate to say this but the best thing is to take this question to the
Rails list; the Ruby list is more about Ruby in general than Rails
specifically. What you’re dealing with there is definitely a Rails
That being said, my guess is that you can probably solve it by doing
paginate(@group.sites, :order => “site_name”)
Since you’ve already got the group, and the sites appear to belong to
it. If I’m right then you’ll also make your app more efficient by
doing this, since the way you have it now looks as if it involves an
additional SQL call.
Alternatively, if the @group.sites thing doesn’t work and it looks as
if you need to do a SQL call to do any pagination, don’t, just search
for “paginate_collection” and “canadaduane” on Google. Add the
paginate_collection code to your application controller and you’ll be
a happy camper.