# Make a user watch a tag using rails

**URL:** https://meta.discourse.org/t/make-a-user-watch-a-tag-using-rails/236900
**Category:** Support
**Created:** [August 22, 2022, 10:34pm UTC](https://meta.discourse.org/t/make-a-user-watch-a-tag-using-rails/236900 "2022-08-22T22:34:31Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![attj](https://avatars.discourse-cdn.com/v4/letter/a/a698b9/32.png) [@attj](https://meta.discourse.org/u/attj)
#### Post date: [August 22, 2022, 10:34pm UTC](https://meta.discourse.org/t/make-a-user-watch-a-tag-using-rails/236900/1 "2022-08-22T22:34:31Z")

</div>

Is there a way of making a user watch a tag using the rails console so that they receive notifications whenever something is posted with that tag? For instance, I am looking for something like:

```plaintext
u=User.find(10)
u.watched_tags = [“tag1”, “tag2”]

```

---

<div class="post-metadata">

### Author: ![attj](https://avatars.discourse-cdn.com/v4/letter/a/a698b9/32.png) [@attj](https://meta.discourse.org/u/attj)
#### Post date: [August 23, 2022, 7:12am UTC](https://meta.discourse.org/t/make-a-user-watch-a-tag-using-rails/236900/2 "2022-08-23T07:12:58Z")

</div>

I gave up on rails and decided to do it with the API, however, sending a put request to “watching\_first\_post\_tags” doesn’t change the variable. Is it possible to do it with the API or rails?
