# Problem embedding images in rss feed via builder?

**URL:** <https://www.ruby-forum.com/t/problem-embedding-images-in-rss-feed-via-builder/173221>\
**Category:** Rails\
**Created:** [August 5, 2009, 5:34am UTC](https://www.ruby-forum.com/t/problem-embedding-images-in-rss-feed-via-builder/173221 "2009-08-05T05:34:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![elliottg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/b77776/32.png) [@elliottg](https://www.ruby-forum.com/u/elliottg)\
**Post date:** [August 5, 2009, 5:34am UTC](https://www.ruby-forum.com/t/problem-embedding-images-in-rss-feed-via-builder/173221/1 "2009-08-05T05:34:06Z")

</div>

I am having no luck embedding images/s in an rss feed I am creating  
using a builder template.

I am sure my image path is correct… I have tried image paths as  
strings as well and I have placed the xml.image block within the  
xml.item block as well as an option. Ultimately I need the image tags  
to be in the item block as each news item will have its own image. But  
the sample code below has the image block as a direct child of the  
channel tag for simplicity’s sake.

Any thoughts on what I am doing wrong?

Thanks! Elliott

* * *

xml.instruct! :xml, :version =\> “1.0”  
xml.rss :version =\> “2.0” do  
xml.channel do  
xml.title " News & Events "  
xml.description “News and Events”  
xml.link home\_index\_url

```
xml.image do
  xml.url @news.first.news_image.url(:public_news_image)
  xml.title "test title"
  xml.link "http://thesiteroot.test"
end

@news.each do |news|
  xml.item do
    xml.title "NEWS __" + news.header
    xml.description news.info
    xml.pubDate news.created_at.to_s(:rfc822)
  end
end

```

end  
end

---

<div class="post-metadata">

**Author:** ![elliottg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/b77776/32.png) [@elliottg](https://www.ruby-forum.com/u/elliottg)\
**Post date:** [August 5, 2009, 2:57pm UTC](https://www.ruby-forum.com/t/problem-embedding-images-in-rss-feed-via-builder/173221/2 "2009-08-05T14:57:10Z")

</div>

Anybody have any ideas on this one?

Thanks
