ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> rubyonrails-talk
rubyonrails-talk
[Rails] Re: Display Options While Paginating
by Partydrone other posts by this author
Jun 19 2007 2:03PM messages near this date
[Rails] Display Options While Paginating | [Rails] How to Use Dell Coupons To Get The Best Deal
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...@[...].com>  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: Ta
lk" group.
To post to this group, send email to rubyonrails-talk@[...].com
To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@[...].com
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
Thread:
Partydrone
Partydrone

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved