Forum: Ruby on Rails how to get the enclosure' url value when reading the rss feed

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
daociyiyou (Guest)
on 2009-04-16 22:04
(Received via mailing list)
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)-%>
        <tr>
         <th>Download:<th>
         <td>
           <%=item.enclosure.url-%>
         <td>
        </tr>
 <%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/
eupdibcj58n5ywbpuzwa/0d231f619d5e84fd1f4c3ab90465915f5e5e665f/
showreelfinder.rss).
How to manage it? Thanks!
daociyiyou (Guest)
on 2009-04-17 04:47
(Received via mailing list)
how to get enclosure tag attr value?
daociyiyou (Guest)
on 2009-04-17 08:03
(Received via mailing list)
I have searched via google,It seems there is not a perfect tutorial
abou this
This topic is locked and can not be replied to.