It's simpler to execute the db query in your main.rb file and then store the result in an instance variable to iterate through here.