所以每次我創建一個新的子公司將其保存到數據庫中,但沒有名字。我不能爲我的生活弄清楚這一點。當創建在Backbone.js的新對象我的屬性保存爲無
class Shop.Views.AffiliatesNew extends Backbone.View
template: JST['affiliates/new']
events:
'submit .form-container': 'addAffiliate'
initialize: ->
@collection.on('reset', @render, this)
@collection.on('add', @render, this)
render: ->
$(@el).html(@template(affiliates: @collection))
this
addAffiliate: (event) ->
event.preventDefault()
@collection.create({
name: $('#first').val()
})
<input type="text" name="name" id="first"/> <br />
.form-title
.submit-container
<input id="affiliate-button" type="submit" value="Submit" />
的價值是得到從請求的瀏覽器發佈? – anushr