Amazon Product API with ruby-aaws

This gem is awesome! I wanted some advice though on how to arrange my
app to be able to load the Amazon Product information into my database.
I understand that I need to create a new record using the items object,
I am just not sure where to actually do this. I set up the Database so
that it can take the “name” record here, now do i need to configure the
controller?I am so lost and having a hard time finding resources or
example code on this, so any advice would be greatly appreciated. Here
is the script code that gives an output:

require ‘rubygems’
require ‘amazon/aws/search’
include Amazon::AWS
include Amazon::AWS::Search

resp = Amazon::AWS.item_search( ‘GourmetFood’, { ‘Keywords’ =>
‘chocolate’ } )
items = resp.item_search_response.items.item

items.each do |item|
attribs = item.item_attributes
name = attribs.title
puts “#{name}”

Thank you!