Adding button click counter in rails 3
问题 I want to add buttons on my article so that I can know the number of times its clicked and update counter on the database, I am using mongoid ,my model is: class Article include Mongoid::Document include Mongoid::Timestamps field :title, :type => String field :content, :type => String field :likes, :type => Integer ,:default => 0 field :dislikes, :type =>Integer, :default => 0 field :spam, :type => Integer, :default => 0 end My articles show controller is: def show @article = Article.find