completed code before testing with an actual rails app