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
On Jun 19, 2:45 pm, partydrone
<partydr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> 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.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---