# A versioned API for client side plugins

**URL:** https://meta.discourse.org/t/a-versioned-api-for-client-side-plugins/40051
**Category:** Development
**Tags:** rest-api
**Created:** [February 23, 2016, 7:20pm UTC](https://meta.discourse.org/t/a-versioned-api-for-client-side-plugins/40051 "2016-02-23T19:20:31Z")
**Posts on this page:** 1
**Showing post:** 22

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [February 25, 2016, 5:06pm UTC](https://meta.discourse.org/t/a-versioned-api-for-client-side-plugins/40051/22 "2016-02-25T17:06:21Z")

</div>

> [@eviltrout](#):
>
> Yes I agree that’s a bit funky. In this case, showRating is a property on the controller right? Is it there because people can enable/disable it on the topic?

You can disable/enable ratings for a category or by adding a tag to a topic.

 ![](https://global.discourse-cdn.com/meta/original/3X/b/e/be0838adabc01b89b0fadb9401216ae5a3b4c2b4.png)

 ![](https://global.discourse-cdn.com/meta/original/3X/1/0/1093d2490d088e02721ecb1ae874a356a711bf7d.png)

I could just check whether the post’s `rating` property has a value and show it if it does, however I will need to provide for hiding ratings in topics that already have them ([see e.g.](https://meta.discourse.org/t/topic-ratings-plugin/39578/14))

However, looking now at @joebuhlig’s nice [Feature Voting plugin](https://meta.discourse.org/t/discourse-feature-voting/40121), I think it would be better if I adopted the approach he’s taken for a similar case - i.e. put this logic in the topic view serializer on the server.

 ![](https://global.discourse-cdn.com/meta/original/3X/c/2/c2a6a85fcf46238608810c754108a91427bdc443.png)

* * *

> Also in your code, I would recommend using includePostAttributes to add rating to attrs rather than calling getModel. I’d also recommend creating a new widget for the rating, but I haven’t written up how to do that yet because I’ve been quite busy ☹ – rawHTML will work but the widget would be nicer and faster

Ah yes, thanks for the tip.

---

_[View the full topic](https://meta.discourse.org/t/a-versioned-api-for-client-side-plugins/40051)._
