# Citestore Plugin

**URL:** <https://meta.discourse.org/t/citestore-plugin/51620>\
**Category:** Development\
**Created:** [2016 年10 月 16 日 23:56 UTC](https://meta.discourse.org/t/citestore-plugin/51620 "2016-10-16T23:56:42Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

作者： ![Silvanus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/silvanus/32/62831_2.png) [@Silvanus](https://meta.discourse.org/u/Silvanus)\
发布日期： [2016 年10 月 17 日 22:18 UTC](https://meta.discourse.org/t/citestore-plugin/51620/5 "2016-10-17T22:18:34Z")

</div>

Can you clarify something for me, still? I’m looking at the code in `discourse-canned-replies` and some other places. For example, the [following](https://github.com/discourse/discourse/blob/0128fdfc4661d90c7d5ed50a08a3f19f902b2d91/app/assets/javascripts/discourse/models/post.js.es6#L140):

```
return ajax("/posts/" + (this.get('id')) + "/recover", { type: 'PUT', cache: false }).then(function(data){
  .... // Do stuff
  });
}).catch(function(error) {
  .... // Do stuff
});

```

So, if I understood correctly, the format is the following, right?

```
ajax(route, data).then( function(data) { do your stuff } ).catch( function (error) { ... } )

```

The first [message](https://meta.discourse.org/t/citestore-plugin/51620/2) implied that that the format would be something more:

```
ajax(route, function(data) { do your stuff } );

```

Or are these the same thing?

* * *

Another question: The parameter data that is given after, if it’s JSON, can I use it out of the box? I mean, I have this in `plugin.rb`:

```
record = Citestore::Storage.get(user_id, handle, locus)
render json: record

```

It should be string. So is the data parameter (variable?) a string as well, or do I need to transform it somehow?

---

_[View the full topic](https://meta.discourse.org/t/citestore-plugin/51620)._
