var CreditCardView = View.extend({ template: $("#creditcard_template").html(), events: { }, initialize: function(opt){ this.parent = opt.parent this.parent.$(".cc").html(this.template) }, populate: function(data){ this.parent.$(".cc input").val("") Object.keys(data).forEach(function(key){ this.parent$(".cc [name=" + key + "]").val(data[key]) }.bind(this)) }, validate_presence: { }, validate_fields: function(data, errors){ }, })