# Will\_Paginate, with muliple same type collection

**URL:** <https://www.ruby-forum.com/t/will-paginate-with-muliple-same-type-collection/155332>\
**Category:** Rails\
**Created:** [December 10, 2008, 6:06pm UTC](https://www.ruby-forum.com/t/will-paginate-with-muliple-same-type-collection/155332 "2008-12-10T18:06:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mark](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e9c0ed/32.png) [@mark](https://www.ruby-forum.com/u/mark)\
**Post date:** [December 10, 2008, 6:06pm UTC](https://www.ruby-forum.com/t/will-paginate-with-muliple-same-type-collection/155332/1 "2008-12-10T18:06:35Z")

</div>

Hi guys:  
i have a question about Will\_paginate .

i have mutilple same type collections.  
for example .

items\_1 = Post.find(:all , :conditions =\>{…}) # different condtions to  
get the items\_1

items\_2 = Post.find(:all, :conditions ={…}) # diffenrt conditions to  
get the item\_2

items = items\_1 | items\_1

then how i am supposed to do in next step ?  
please help

---

<div class="post-metadata">

**Author:** ![mark](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e9c0ed/32.png) [@mark](https://www.ruby-forum.com/u/mark)\
**Post date:** [December 10, 2008, 6:22pm UTC](https://www.ruby-forum.com/t/will-paginate-with-muliple-same-type-collection/155332/2 "2008-12-10T18:22:41Z")

</div>

(the “Mark Ma” from Railsconf 07’?)

On 10-Dec-08, at 12:06 PM, Mark Ma wrote:

> items\_2 = Post.find(:all, :conditions ={…}) # diffenrt conditions to  
> get the item\_2
> 
> items = items\_1 | items\_1
> 
> then how i am supposed to do in next step ?  
> please help

you can use the + ‘method’ to add collections

items = items\_1 + items\_2

but might make more sense to merge the conditions into an OR?

items = Post.find(:all, :conditions =\> “(#{item\_one\_conditions}) OR  
(#{item\_2\_conditions})”)

Jodi
