Rails: Proper work flow to shred XML data into relational SQL database
I have a Rails project and I used Migrations to setup the database schema (I'm using sqlite3). 开发者_运维百科I have a XML file that I want to insert into my database. What's the best way to approach this? I'm thinking there's some Ruby script that I can write once and use to parse the XML file and insert it into my database, but intuitively it feels like this is a common problem and should have already been automated in the Ruby/Rails world. I guess some people would call this XML shredding, but querying Google hasn't turned up much for me.
Any thoughts?
db/seeds.rb could be a good place to put the data.
精彩评论