This is the full code that works on heroku for the ruby on rails program