Ziyan Junaideen
Ziyan Junaideen

Reputation: 3300

Ruby Highrise API - Add Remove Tags from Person

How can one add and remove tags using the Highrise API. I believe my issue is due to the lack of knowledge in ActiveResources, which Highrise GEM is been based on.

Now I tried some thing like this...

person = Highrise::Person.find(1234)
person.update_attributes(tags: [ { id: 9876, _destroy: true } ])

Though returns true, doesn't remove the tag association.

I would like to know how to remove a tag from a person. Thanks in advance.

Upvotes: 1

Views: 66

Answers (1)

Eric Duminil
Eric Duminil

Reputation: 54283

Looking at the gem sourcecode, it seems that Highrise::Person is Taggable.

So you could do :

person = Highrise::Person.find(1234)
person.untag!(tag_name)

Note that you need to provide a tag_name, not its id.

Upvotes: 2

Related Questions