Forum: Ruby on Rails Pagination & Feedtools

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Alex (Guest)
on 2006-03-13 20:20
Is it possible to paginate rss feeds with FeedTools.
The following code generates an error about constants.

  latest_feeds =
FeedTools::Feed.open('http://feeds.feedburner.com/Eribium')

  @news_pages, @pages = paginate :latest_feeds, :per_page => 5
Bob A. (Guest)
on 2006-03-13 23:02
(Received via mailing list)
> Is it possible to paginate rss feeds with FeedTools.
> The following code generates an error about constants.
>
>   latest_feeds =
> FeedTools::Feed.open('http://feeds.feedburner.com/Eribium')
>
>   @news_pages, @pages = paginate :latest_feeds, :per_page => 5

Of course it does.  The value you get back from FeedTools::Feed.open()
isn't an ActiveRecord object.  If you want to do pagination directly,
you have to do it manually, but be aware that it will likely not give
you any performance boost at all.  The only way to get pagination to
do you any real good would be to save the values you want to make use
of, from the feed into another table, and paginate that.  And that's
kinda how you're supposed to use FeedTools most of the time anyways
when pairing it with Rails.

Cheers,
Bob A.
This topic is locked and can not be replied to.