# How to get the enclosure' url value when reading the rss feed

**URL:** <https://www.ruby-forum.com/t/how-to-get-the-enclosure-url-value-when-reading-the-rss-feed/165726>\
**Category:** Rails\
**Created:** [April 16, 2009, 8:04pm UTC](https://www.ruby-forum.com/t/how-to-get-the-enclosure-url-value-when-reading-the-rss-feed/165726 "2009-04-16T20:04:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![daociyiyou](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/0ea827/32.png) [@daociyiyou](https://www.ruby-forum.com/u/daociyiyou)\
**Post date:** [April 16, 2009, 8:04pm UTC](https://www.ruby-forum.com/t/how-to-get-the-enclosure-url-value-when-reading-the-rss-feed/165726/1 "2009-04-16T20:04:19Z")

</div>

how to get the enclosure’ url value when reading the rss feed? I  
define a help method to judge if there is a enclosure in a rss  
item,and use it in a view,the codes are following:  
########  
module EncodeHelper  
def enclosure?(item)  
if item.to\_s.scan(“\<enclosure”).length \> 0  
return true  
else  
return false  
end  
end  
end  
#########  
the view codes:  
\<%if enclosure?(item)-%\>  
  
Download:  
  
\<%=item.enclosure.url-%\>  
  
  
\<%end-%\>  
##########  
I got nothing about enclosure’s url value and display,but indeed,there  
are enclosure tag in the rss page source code ([http://drop.io/](http://drop.io/)  
eupdibcj58n5ywbpuzwa/0d231f619d5e84fd1f4c3ab90465915f5e5e665f/  
showreelfinder.rss).  
How to manage it? Thanks!

---

<div class="post-metadata">

**Author:** ![daociyiyou](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/0ea827/32.png) [@daociyiyou](https://www.ruby-forum.com/u/daociyiyou)\
**Post date:** [April 17, 2009, 2:47am UTC](https://www.ruby-forum.com/t/how-to-get-the-enclosure-url-value-when-reading-the-rss-feed/165726/2 "2009-04-17T02:47:01Z")

</div>

how to get enclosure tag attr value?

---

<div class="post-metadata">

**Author:** ![daociyiyou](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/0ea827/32.png) [@daociyiyou](https://www.ruby-forum.com/u/daociyiyou)\
**Post date:** [April 17, 2009, 6:03am UTC](https://www.ruby-forum.com/t/how-to-get-the-enclosure-url-value-when-reading-the-rss-feed/165726/3 "2009-04-17T06:03:53Z")

</div>

I have searched via google,It seems there is not a perfect tutorial  
abou this
