I'm trying to generate atom feed for special offers.
The controller works fine so the link http://localhost:3000/offers.atom
render some xml.
I have a list of offers in http://localhost:3000/offers
page. For each offer I don't have the show page becouse the original product is in an other web site. So in http://localhost:3000/offers
page I'm only listing the offers but if I click in a specific offer I'm redirected to another web site.
My problem is generating the atom xml file:
#app/views/offers/index.atom.builder
atom_feed do |feed|
feed.title "title"
feed.updated @offers.maximum(:updated_at)
@offers.each do |offer|
feed.entry(offer, url: offer.product_link) do |entry|
entry.image image_tag(offer.img_link)
entry.title offer.desc
entry.description offer.desc
entry.price offer.price
entry.special_price offer.special_price
entry.saving offer.saving
end
end
end
The validator find some errors in my xml file. This is my xml file:
<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
<id>tag:localhost,2005:/offers</id>
<link rel="alternate" type="text/html" href="http://localhost:3000"/>
<link rel="self" type="application/atom+xml" href="http://localhost:3000/offers.atom"/>
<title>title</title>
<updated>2014-04-08T12:33:24Z</updated>
<entry>
<id>tag:localhost,2005:Offer/116</id>
<published>2014-04-08T12:33:24Z</published>
<updated>2014-04-08T12:33:24Z</updated>
<link rel="alternate" type="text/html" href="http://e-commerce.centroservizirovigo.com/Detail.aspx?ProductId=2101845"/>
<img><img alt="738750a1" src="http://e-commerce.centroservizirovigo.com//Images/1480/738750A1.jpg" /></img>
<title>Rilegatrice termica T400 GBC - 400 fogli - 4400411</title>
<description>Rilegatrice termica T400 GBC - 400 fogli - 4400411</description>
<price>167.7</price>
<special_price>124.0</special_price>
<saving>26.1</saving>
</entry>
</feed>
But I have no idea to solve.