不同用户的独特标签
我目前正在调查 ActsAsTaggableOn 是否能满足我的需求。具体来说,我有一个应用程序,用户可以在其中注册和添加人员。他们可以给人们贴上标签。但是,我想将一个用户创建的标签与另一用户创建的标签分开。
这似乎是一个常见的要求,所以我有点惊讶,这显然不是最重要的。这可能吗?如果可以,怎么做?
谢谢!
I'm currently investigating whether ActsAsTaggableOn is going to work for my needs. Specifically, I have an application where users can sign up and add people. They can tag people. However, I want to segregate the tags that one user creates from the tags that another user creates.
It seems like this would be a common requirement, so I'm a little surprised that it's not something obviously front and centre. Is this possible to do, and if so, how?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
ActsAsTaggableOn 不支持您需要的功能。我建议滚动您自己的标记系统并使用 ActsAsTaggableOn 作为适当结构的示例。
我会使用类似的结构,只不过标签表还包含一个用户 ID,然后您可以使用该 ID 将标签范围限定到当前用户。
ActsAsTaggableOn does not support the functionality you need. I would recommend rolling your own tagging system and use ActsAsTaggableOn as an example of appropriate structures.
I would use a similar structure, except have the tag table also contain a user id that you could then use to scope tags to the current user.
ActsAsTaggableOn
支持创建模型acts_as_tagger
,它允许您检索它们已标记的标签 (https://github.com/mbleigh/acts-as-taggable-on)。看来你说的就是这个。特别是“希望”这一行
有帮助。
ActsAsTaggableOn
supports making a modelacts_as_tagger
, which allows you to retrieve the tags they've tagged (https://github.com/mbleigh/acts-as-taggable-on). It seems like this is what you're talking about.Particularly the line
Hope that helps.