I have an Item model, with a few attributes, which I show as a list on the home page.
I want to be able to make that <li>‘s content into an edit form for that Item, and on submitting, if there were no validation errors, restore <li>‘s contents (with updated values).
You can assume that the Item just has one string attribute named title, that should be enough for me to adapt into a bigger model.
How should I approach this? I’m guessing I need to somehow generate the forms on the server side, and bring them into the li, as it would be easy to integrate error handling with that, but I’m not sure how I can do that elegantly.
I inserted an edit form with display:none, and made it appear on double click.