somawater/deckhand — pull request #5 by elvanja (2014-01-30 11:10:47+00:00)
Title: Edit model fix:

Solves the issue with showing previous content for single edit.

Manually forced the response for single edit request to match action form response. Actually wraps model fields in a "values" keyed hash. E.g. compare :

Pause action response:
```json
{
title: null,
prompt: null,
values: {
pause_reason: {
value: null,
choices: null
},
hide: {
value: true,
choices: null
}
}
}
```

Current edit response:
```json
{
_model: "Order",
_label: "Order f9cde",
id: "52e194469bea15e113000004",
values: {
internal_note: {
value: "prova1"
}
}
}
```

Previous edit response:
```json
{
_model: "Order",
_label: "Order f9cde",
id: "52e194469bea15e113000004",
internal_note: {
value: "prova1"
}
}
```

This solves the issue with single edits. I tried solving entire object edit too, and thought it had to do with the same representation. If I use ```model_config.flat_fields``` on line 36 I get the correct wrapping, but unfortunately again only the explicit edit field is shown in the form. Am I understanding this incorrectly, maybe only ```:edit``` fields are to be shown on the form?