powmedia/backbone-forms — pull request #92 by abevoelker (2012-07-06 14:53:20+00:00)
Title: Fix rendering of radio button fields with spaces in values

I am writing a "wizard" type of app using backbone-forms that has the behavior of re-rendering backbone-forms views that have already been `commit()`ed. With radio button fields that have *spaces* in the values, selecting one these values, `commit()`ing it and re-rendering it always sets the `checked` HTML attribute to the last value in the list rather than the one that was selected. Here's an example:

```javascript
var RadioWithSpaces = Backbone.Model.extend({
schema: {
test: { type: 'Radio', options: ['foo bar', 'baz', 'quux'] }
}
});
```

If you select `foo bar` and commit the form, then re-render it, the HTML that gets rendered looks like this (with `quux` checked):

```html

foo bar

baz

quux

```

rather than the expected

```html

foo bar

baz

quux

```

Interestingly it looks like [checkboxes](https://github.com/powmedia/backbone-forms/blob/master/src/editors.js#L525) already do this correctly.

Apologies for not writing an actual test case for this; kind of busy at work atm.