Hay guys, im pretty new to rails and im working on my first little
project (well it's a page for a friend so ˆˆ) and until now i got no
problems. But no i got my first little problem and not sure how to solve
it right :s.
I have a database with a table called game_pairs where i want to store
game parings of the bundesliga (soccer league in germany). I want to
store them only one time on the setup of the page. So i thought i create
a little helper method in an extra file in lib/assets called
get_game_data.rb. I already got the data from a website, so that works.
But now i don't know how to store this data into the database since i
can't use the database model from rails. How do i save them into the
database?
if it matters:
The data have this format :
array[{hash with data}, ..., {hash with data}].
i want to create 1 db entry for each hash. The hash looks like this
{date: 12.12.12, home_team: Fc Foo, guest_team: Fc Bar}
I hope didn't forget something and you could help me solve this problem
:)
greets
Luca
--
Posted via
http://www.ruby-forum.com/.