how to get enclosure tag attr value?
On Apr 17, 2:03 am, daociyiyou <[email protected]> wrote:
> 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!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---