Atom Feed Helper plugin

Plugin details

Makes it easier to create atom feeds through Builder.

Repositoryhttp://dev.rubyonrails.org/svn/rails/plugins/atom_feed_helper/ Author David Heinemeier Hansson Tags RSS LicenseMIT

Documentation

Install the plugin:
ruby script/plugin install http://dev.rubyonrails.org/svn/rails/plugins/atom_feed_helper/
# from PostsController
def index
  @posts = Post.find(:all, :limit => 25)
    
  respond_to do |format|
    format.html
    format.atom
  end
end

# from posts/index.atom.builder

atom_feed(:url => formatted_people_url(:atom)) do |feed|
  feed.title("Address book")
  feed.updated(@people.first ? @people.first.created_at : Time.now.utc)
  
  for post in @posts
    feed.entry(post) do |entry|
      entry.title(post.title)
      entry.content(post.body, :type => 'html')

      entry.author do |author|
        author.name(post.creator.name)
        author.email(post.creator.email_address)
      end
    end
  end
end


... will produce Atom feed.

Further Documentation

There is currently no advanced documentation for this plugin.

New documentation

Edit plugin | Back in time (4 older versions) | Last edited by: maxim_kulkin, about 1 year ago