This project is archived and is in readonly mode.

#1007 ✓committed
Sam Ruby

Add XHTML support to the atom_feed_helper

Reported by Sam Ruby | September 9th, 2008 @ 08:17 PM | in 2.x

The use case here is that I want to provide a feed from an arbitrary ActiveRecord, i.e., one that contains data, not "content" or even a pre-canned summary. As an example, we might be looking at an order with line items.

Since there is no summary, we would want to create one. Of course we can do the whole HTML-in-string thing, and that should continue to be supported.

This patch makes it easier to use builder to produce the HTML for you. To use, simply specify :type=>"xhtml" on any content, rights, subtitle, summary, or title element and pass in a block. For example:

  entry.summary :type => 'xhtml' do |xhtml|
    xhtml.p pluralize(order.line_items.count, "line item")
    xhtml.p "Shipped to #{order.address}"
    xhtml.p "Paid by #{order.pay_type}"
  end

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Pages