What I try to achieve: user goes to post/3/edit. Here the form is bound to the model, so it already filled out. And on the top
You are editing the post {{model.title}}
If the user changes the title it changes dynamic. I don't want this behavior. I want to apply the changes to the record, if user already hit the "Save" button (and everything went right on server side).
my idea:
- clone the record
- bind cloned record to the form
- after hit "Save" the properties of the cloned (and edited) record are applied to the original record.
Questions
- Is this the right way to do this?
- Is there something like
record.clone()
, which deep copy the record with it's relations? - Is there a way to apply the changes, like
originalRecord.apply(clonedRecord)
?
Aucun commentaire:
Enregistrer un commentaire