change has_and_belongs_to_many association to has_many, through on the posts and tags