How to apply tags with acts_as_taggable_on using check boxes?

前端 未结 2 806
借酒劲吻你
借酒劲吻你 2020-12-24 10:01

I would like to assign two different \"types\" of tags (sector categories and free tagging) to a Company model using acts_as_taggable_on. NB: I\'m new to RoR!

This i

2条回答
  •  醉话见心
    2020-12-24 10:42

    It seems that act_as_taggable_on uses single table inheritance, so you actually don't need to create any additional tables. However you do need to follow their convention (that they never stated) as follows:

    //add to model
    attr_accessible :yourfieldname_list
    acts_as_taggable_on :yourfieldname
    
    //view
    <%= f.text_field :yourfieldname_list %>
    

提交回复
热议问题