Add ajax, slug and correct two errors: 1.always make sure what obj you're refering/using/parsing. 2.format was wrong because the if condition only deal the situation when @vote.save is tru