Use the c method in gem: act_as_tagger in the User model to customize user-specific tags. Example for actions_as_taggable_on gem docs:
class User < ActiveRecord::Base acts_as_tagger end class Photo < ActiveRecord::Base acts_as_taggable_on :locations end @some_user.tag(@some_photo, :with => "paris, normandy", :on => :locations) @some_user.owned_taggings @some_user.owned_tags @some_user.tag(@some_photo, :with => "paris, normandy", :on => :locations, :skip_save => true)
In your case, you will need to set up a connection table, which includes identifiers: Habits, Goals, Valuations and Quantifieds, and then you can create a variable to call up the tag counter in this table or to customize each skill, goals, ratings and quantitative estimates in your submissions for a specific user. In any case, it should look something like this:
@tags = YourModel.tag_counts_on(**context**)
UPDATE ATTEMPT
class User < ActiveRecord::Base acts_as_tagger end class Habit < ActiveRecord::Base # This goes for Valuation, Goal, and Quantified too. acts_as_taggable_on :combine_tags end class CombineTag < ActiveRecord::Base belongs_to :habit belongs_to :goal belongs_to :quantified belongs_to :valuation end
I tried to migrate:
class CreateCombineTags < ActiveRecord::Migration def change create_table :combine_tags do |t| t.valuation_id :integer t.goal_id :integer t.quantified_id :integer t.habit_id :integer t.timestamps null: false end end end
but I got an undefined method 'valuation_id' for #<ActiveRecord:: I donβt know if has_many and belongs_to enough to join the models that I am going to accept yes.
Then what should I do with @tags = YourModel.tag_counts_on(**context**) ? What does context mean? Does this happen in _tags.html.erb ? If it were like this:
<% @tags = CombineTag.tag_counts_on(**???**) <% tag_cloud @tags.tag_counts, %w{sml} do |tag, css_class| %> <%= link_to tag.name, tag_path(tag.name), class: css_class %> <% end %>