Sha256: 748a437b1b7b1f460d0c6ad35e38a93c48a9f385791a9999872fdb855bd48f90

Contents?: true

Size: 540 Bytes

Versions: 11

Compression:

Stored size: 540 Bytes

Contents

Backbone = require('backbone')
config = require('../config')
querystring = require('querystring')

module.exports = class Card extends Backbone.Model
  idAttribute: 'title'

  isNew: ()->
    @_isNew

  url: ()->
    if @isNew()
      console.log @
      console.log 'url is new'
      url = '/cards.json'
    else
      console.log 'url is not new'
      url = '/cards/' + encodeURIComponent(@get('title')) + '.json'
    config.root_path + config.api_path + url

  parse: (response)->
    if response.card then response.card else response

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
carte-server-0.0.25 lib/carte/client/models/card.coffee
carte-server-0.0.24 lib/carte/client/models/card.coffee
carte-server-0.0.23 lib/carte/client/models/card.coffee
carte-server-0.0.22 lib/carte/client/models/card.coffee
carte-server-0.0.21 lib/carte/client/models/card.coffee
carte-server-0.0.20 lib/carte/client/models/card.coffee
carte-server-0.0.19 lib/carte/client/models/card.coffee
carte-server-0.0.18 lib/carte/client/models/card.coffee
carte-server-0.0.17 lib/carte/client/models/card.coffee
carte-server-0.0.16 lib/carte/client/models/card.coffee
carte-server-0.0.15 lib/carte/client/models/card.coffee