Skip to content

Instantly share code, notes, and snippets.

@rbpasker
Created February 13, 2013 18:32
Show Gist options
  • Select an option

  • Save rbpasker/4946915 to your computer and use it in GitHub Desktop.

Select an option

Save rbpasker/4946915 to your computer and use it in GitHub Desktop.
// A `collection` representing a view result. View query parameters should be
// passed in via `cloudant_options`.
Backbone.Cloudant.View = {
Collection: Backbone.Cloudant.Collection.extend({
// Name of the design document containing the view.
design: "my_design",
// Name of the view.
view: "my_view",
// Generate the correct base URL (without query parameters) for the view.
baseURL: function(){
return [Backbone.Cloudant.database, "_design", this.design, "_view", this.view].join("/");
}
})
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment