You can move this javascript down to you :javascript block. I think it'd be like `$("#voteform").submit(doVote)`