Display Options While Paginating

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.

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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs