Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Html formatting w/ Atom feeds

Status
Not open for further replies.

clemcrock

Programmer
Dec 17, 2006
63
US
Hello,
I'm having a great time building some rss/atom feeds and I've been quite successful until I hit the html formatting line of the Atom feed.

Here's an example:

Code:
xml.instruct! :xml, :version=>"1.0", :encoding=>"UTF-8"

  xml.feed "xml:lang" => "en-US", "xmlns" => '[URL unfurl="true"]http://www.w3.org/2005/Atom[/URL] ' do
    xml.title("flavor: #{@flavor} *title1: " + @feed.title)
    xml.id( "tag:#{request.host},#{Time.now.utc.year}:#{@feed.title}/#{@feed.title.downcase}" )
    xml.link('url: ' + @ feed.guid) if @feed.guid
    xml.author  { xml.name "Author Name" }
    
     @entities.each do |entity|
       xml.entry do
         xml.title('title: ' + entity.title )
         xml.link("rel" => "alternate", "href" => url_for(url_for :only_path => false, :controller => @this_controller, :action => @this_action, :id => entity.id))
         xml.id(url_for(:only_path => false, :controller => @this_controller, :action => @this_action, :id => entity.id))
         xml.updated("#{Time.now.utc.year}")
         
         xml.content "type" => "html" do
           xml.name entity.body   #-->>tried this - doesn't work
           xml.text! render(:partial => "shared/feed/entity", :entity => entity)-->>Tried this - doesn't work
           
         end
       end
     end
  end

If I could just get the
Code:
xml.content "type" => "html" do
end

section to work I would be home free.

Help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top