AtomFeedHelper and AtomFeedHelper::AtomFeedBuilder

Atom feeds started out as more or less the next generation of RSS syndication feeds. RSS can stand for Really Simple Syndication, Rich Site Summary, or RDF Site Summary, which is part of why Atom’s developers decided to start over with a new name. Syndication feeds make it easy for sites, especially news sites and weblogs, to share their content with other websites and consumers, offering a simpler format for articles than full HTML pages. Atom, especially its REST-based Atom Publishing Protocol (AtomPub), has grown beyond just exchanging lists of articles, but Rails’ built-in helper functions focus on fairly traditional feed applications.

AtomHelper is mostly used in Builder templates for creating XML:

atom_feed

Takes a block, creating an atom:feed element and giving the block an AtomFeedBuilder object that child components can use for context. It also accepts parameters for :language, :root_url, :url, and :schema_date.

entry

Creates an atom:entry element. Accepts parameters for :published, which represents the time when the entry was first published, :update, which represents the time of the latest changes, and :url, where to find the entry.

updated

Takes a time and converts it to the right format for Atom feed times.

Get Learning Rails: Live Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.