This project is archived and is in readonly mode.
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
-
DHH September 10th, 2008 @ 04:52 AM
Looking good. I've rewritten part of the patch to be a bit more idiomatic to the Ruby style used in Rails and extracted a method for better overview. But we still need to change the documentation too before this can go in.
-
DHH September 10th, 2008 @ 04:56 AM
- State changed from new to incomplete
Change ticket status to verified when docs are added.
-
Sam Ruby September 10th, 2008 @ 01:55 PM
Docs added. I don't believe I have sufficient karma to change the ticket status.
-
DHH September 10th, 2008 @ 10:16 PM
- State changed from incomplete to open
-
DHH October 13th, 2008 @ 06:58 PM
- State changed from open to committed
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>