I was wondering if someone can help me understand this part in the documentation:
With the defined context in model, you have multiple new methods at disposal to manage and view the tags in the context. For example, with :skill context these methods are added to the model: skill_list(and skill_list.add, skill_list.remove skill_list=), skills(plural), skill_counts.
I have this:
model:
class Project < ActiveRecord::Base
acts_as_taggable # Alias for acts_as_taggable_on :tags
acts_as_taggable_on :item
end
controller:
def project_params
params.require(:project).permit(
:user_id, :tag_list)
end
view
<%= f.text_field :tag_list %> <!-- wrapped in a simple_form -->
So my question is... does that mean, if I have :items
in my model, I can replace all the :tag_list
into :item_list
? And just use item_list from now on? I tried this, but its not producing the same results as what I currently have... maybe I messed up somewhere, but is this "theoretically" correct?
Thanks
BONUS:
So eventually, if I have more than one thing that I want to tag:
acts_as_taggable_on :item, :more_taggable_item
I can have this in my strong params
params.require(:project).permit(
:user_id, :tag_list, :more_taggable_item_list)
and then I can use it in my view:
<%= f.text_field :more_taggable_item_list %>