# Changing a category default view from the command line

**URL:** https://meta.discourse.org/t/changing-a-category-default-view-from-the-command-line/163428
**Category:** Support
**Created:** [September 8, 2020, 10:47pm UTC](https://meta.discourse.org/t/changing-a-category-default-view-from-the-command-line/163428 "2020-09-08T22:47:06Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![davidkingham](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/davidkingham/32/119528_2.png) [@davidkingham](https://meta.discourse.org/u/davidkingham)
#### Post date: [September 8, 2020, 10:47pm UTC](https://meta.discourse.org/t/changing-a-category-default-view-from-the-command-line/163428/1 "2020-09-08T22:47:06Z")

</div>

I need to change the `default_view` setting for a category from the command line due to a plugin conflict. I have tried this but it’s not working, can anyone help a rails noob? Thanks!

```
myCategory = Category.find_by(id: 8)
myCategory.default_view = "latest"

```

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [September 9, 2020, 7:27am UTC](https://meta.discourse.org/t/changing-a-category-default-view-from-the-command-line/163428/2 "2020-09-09T07:27:44Z")

</div>

Sorry David. You need to do

```plaintext
MyCategory.save!

```

Directly afterwards 😊

---

<div class="post-metadata">

### Author: ![davidkingham](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/davidkingham/32/119528_2.png) [@davidkingham](https://meta.discourse.org/u/davidkingham)
#### Post date: [September 9, 2020, 2:17pm UTC](https://meta.discourse.org/t/changing-a-category-default-view-from-the-command-line/163428/3 "2020-09-09T14:17:39Z")

</div>

> [@merefield](#):
>
> `MyCategory.save!`

Thanks Rob, I was trying to not bother you since you’re a busy man! 🙂

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [September 9, 2020, 2:19pm UTC](https://meta.discourse.org/t/changing-a-category-default-view-from-the-command-line/163428/4 "2020-09-09T14:19:17Z")

</div>

No problem at all. Thanks David!

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [October 9, 2020, 2:25pm UTC](https://meta.discourse.org/t/changing-a-category-default-view-from-the-command-line/163428/5 "2020-10-09T14:25:24Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
