Hi, great work on the gem, I am working with Active Admin and added the acts_as_taggable_on gem, problem is two models, templates and accounts, I want templates to be taggable while tags will be scoped to accounts. With Active Admin I have can create a tag without tagging it to template which is what I want, but the problem is, I need to be able to assign an account as the owner of the newly created tag, I have tried using this example from the wiki,
@some_user.tag(@some_photo, :with => "paris, normandy", :on => :locations)
but it only means an owner can only be added after an object has been tagged but I want to add an owner after creating the tag. below is the code I where I tried to add an owner to the tag after creating it.
ActiveAdmin.register ActsAsTaggableOn::Tag, as: "Tag" do
controller do
def create
super
acct = Account.last.tag(params[:acts_as_taggable_on_tag])
end
end
end
Account model
class Account < ApplicationRecord
acts_as_tagger
end
Template Model
class ItemTemplate < ItemParent
# after_save :set_tag_owner
acts_as_taggable
end
Or does it mean a tag can't be assigned an owner unless it has been tagged to an object ?
Hi, great work on the gem, I am working with Active Admin and added the acts_as_taggable_on gem, problem is two models, templates and accounts, I want templates to be taggable while tags will be scoped to accounts. With Active Admin I have can create a tag without tagging it to template which is what I want, but the problem is, I need to be able to assign an account as the owner of the newly created tag, I have tried using this example from the wiki,
@some_user.tag(@some_photo, :with => "paris, normandy", :on => :locations)
but it only means an owner can only be added after an object has been tagged but I want to add an owner after creating the tag. below is the code I where I tried to add an owner to the tag after creating it.Account model
Template Model
Or does it mean a tag can't be assigned an owner unless it has been tagged to an object ?