Back end (server side) of referral app using Ruby on Rails 4.0.2