# Display Options While Paginating

**URL:** <https://www.ruby-forum.com/t/display-options-while-paginating/107272>\
**Category:** Rails\
**Created:** [June 19, 2007, 10:45pm UTC](https://www.ruby-forum.com/t/display-options-while-paginating/107272 "2007-06-19T22:45:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![partydrone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a6a055/32.png) [@partydrone](https://www.ruby-forum.com/u/partydrone)\
**Post date:** [June 19, 2007, 10:45pm UTC](https://www.ruby-forum.com/t/display-options-while-paginating/107272/1 "2007-06-19T22:45:55Z")

</div>

I have a table full of articles that I want to paginate. Easy enough  
with:

[Controller]  
@article\_pages, @articles = paginate(:articles, :per\_page =\>  
20, :order =\> ‘post\_date DESC, title ASC’)

BUT, there are different types of articles: regular news articles  
(designated NA), and press releases (designated PR).

If I want to put each type in a different table on the same page, what  
is a good way to go about doing that?

Thanks.

---

<div class="post-metadata">

**Author:** ![partydrone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a6a055/32.png) [@partydrone](https://www.ruby-forum.com/u/partydrone)\
**Post date:** [June 19, 2007, 11:03pm UTC](https://www.ruby-forum.com/t/display-options-while-paginating/107272/2 "2007-06-19T23:03:55Z")

</div>

Got it:

def list  
@article\_pages, @articles = paginate(:articles, :per\_page =\>  
20, :order =\> ‘post\_date DESC, title ASC’)  
@press\_releases = []  
@news\_articles = []  
for article in @articles  
@press\_releases \<\< article if article.article\_type == ‘PR’  
@news\_articles \<\< article if article.article\_type == ‘NA’  
end  
end
