#98 Inline editing attributes with Hotwire

05/12/2022
hotwire

Allow user to easily edit an attribute by just clicking on it!
This way you can have fewer full-page redirects; don't have to always render a full edit form.
5 years ago I would have used gem best_in_place for this, but now it can be easily achieved with turbo_frames!

Episode source code: https://github.com/corsego/98-hotwire-inline-edit-attributes/commit/1e6154863cff969bec5266add752a9d591f5a1a4

Text version: https://blog.corsego.com/hotwire-inline-edit-attributes

0:00 Inline editing problem
1:20 Edit single attribute inline
5:15 Edit any attribute individually
10:00 Link to edit empty value
10:35 Validations
11:40 Save by clicking outside
13:00 Optionally render whole edit form

2
Sign in to join the conversation