powmedia / backbone-forms

Form framework for BackboneJS with nested forms, editable lists and validation
MIT License
2.17k stars 413 forks source link

Allow for setting defaults on the prototype of objects extending #292

Closed patbenatar closed 11 years ago

patbenatar commented 11 years ago

Backbone.Form wants defaults such as template to either be defined on the constructor or as an option at initialization. It completely ignores them when defined on the prototype.

As the Backbone convention is to define things like template on the prototype, many people try and fail.. I've seen a couple issues like #226 as a result of this. This PR attempts to alleviate some of that pain by allowing defaults to be set on the prototype.

Thoughts?

powmedia commented 11 years ago

Makes sense, would you be able to include tests?

patbenatar commented 11 years ago

@powmedia Sure thing.. I'll post an update here when I have a chance

patbenatar commented 11 years ago

@powmedia Tests included in above commit

powmedia commented 11 years ago

Merged, thanks @patbenatar