如何将第二个参数添加到acts_as_taggable_on_steroids插件中的标签中
在我的Rails应用程序中,我尝试使用acts_as_taggable_on_steroids插件,但它有点不足。我想向每个标签添加第二个参数来描述它所标记的内容。不是类,我理解是记录在标记连接表中。例如,如果我要标记一次采访,我会以(“微软”,“公司”),(“校园”,“位置”)的形式给它多个标签。目前,向项目添加标签的唯一方法是使用 Model.tag_list.add(*args)
。对我来说修改插件或者从头开始会更容易吗?
In my Rails application I am trying to use the acts_as_taggable_on_steroids plugin but it is falling short a little bit. I would like to add a second parameter to each tag that describes what it is tagging. Not the class, I understand that is recorded in the taggings join table. For example, if I were to tag an interview, I would give it multiple tags in the form of ("microsoft","company"), ("campus", "location"). Currently the only way to add tags to an item is with Model.tag_list.add(*args)
. Would it be easier for me to modify the plugin or to start from the ground up?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我决定将acts-as-taggable-on-steroids 换成acts-as-taggable-on,它有一个叫做上下文标记的东西。
I've decided that I am going to switch out acts-as-taggable-on-steroids for acts-as-taggable-on which has something called context tagging.