How to fix duplicate taggings?
问题 Users can submit tags for Habits, Goals, Values, and Stats. When a user clicks on a tag in the tag_cloud he is redirected to the home page with all the instances of that tag, but for some reason the instances that fall under Habits are duplicating. Any ideas on why this is? pages_controller @habits = current_user.habits.tagged_with(params[:tag]) habit.rb class Habit < ActiveRecord::Base belongs_to :user acts_as_taggable before_save :set_tag_owner def set_tag_owner # Set the owner of some tags