An exercise for ruby on rails app