Skip to content

Instantly share code, notes, and snippets.

@radar
Forked from bluehallu/gist:7094935
Last active December 26, 2015 04:39
Show Gist options
  • Save radar/7094942 to your computer and use it in GitHub Desktop.
Save radar/7094942 to your computer and use it in GitHub Desktop.
xml = params[:upload]
xml = Nokogiri::XML(xml)
xml.xpath('//movie').each do |tag|
movie = Movie.from_tag(tag)
# do what you wish with movie here
end
class Movie < ActiveRecord::Base
def self.from_tag(tag)
new(:title => tag.title)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment