Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Add XHTML support to the atom_feed_helper

#1007

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

Reported by Sam Ruby · September 9th, 2008 @ 08:17 PM

State: committed
Milestone: 2.x
Assigned to: nobody
Importance: none

Activity

  1. DHH
    DHH

    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.

    September 10th, 2008 @ 04:52 AM

  2. DHH
    DHH
    • State changed from new to incomplete

    Change ticket status to verified when docs are added.

    September 10th, 2008 @ 04:56 AM

  3. Sam Ruby
    Sam Ruby

    Docs added. I don't believe I have sufficient karma to change the ticket status.

    September 10th, 2008 @ 01:55 PM

  4. DHH
    DHH
    • State changed from incomplete to open

    September 10th, 2008 @ 10:16 PM

  5. DHH
    DHH
    • State changed from open to committed

    October 13th, 2008 @ 06:58 PM