Server code (Ruby on Rails) for PourLogic project