Why are you doing model updating in the view? Can you post the
corresponding controller code?
You use a loop to read every record in your table, and inside that
loop, the line:
voting.update_attribute('vote_count', voting.vote_count+1 )
updates every record adding one to the previous value. Your "if
voting.question....." encloses only the line below it (It appears that
<% end %> is missing.