back end for a poll system in Ruby on Rails