I have model with pictures and videos
How to check the enclosure_type
then save in the proper location?
feed_entry.rb
class FeedEntry include Mongoid::Document field :enclosure_url, type: String field :enclosure_type, type: String field :video, type: String mount_uploader :picture, PictureUploaderend
For example:
feed = Feedjira::Feed.fetch_and_parse 'http://example.com/feed.xml'feed.entries.first.enclosure_url # => "http://example.com/d260eb5c"feed.entries.first.enclosure_type # => "image/jpeg"feed.entries.last.enclosure_url # => 'https://youtu.be/AnXR-MKhg64'feed.entries.last.enclosure_type # => "video/x-ms-asf"