How do you handle "cancel" button when update a record?

Hi everyone,

First of all, I want to thank you for your time. This question sounds dump, but let me explain my situation.

I have a big table, which has about 8m records.

I have a list page that loads about 100 records from that table. It is slow to load this page. I also implemented caching for this page.

I implemented inline edit on the page using Hotwire. When update a record, there is a cancel button. And in all tutorials, I found, the cancel button is always link_to the list page. This would cause the problem in my case, since my list page is too slow to load.

Cancel an edit shouldn’t be that slow. Is there any other way to work around this?

Thank you so much


Just an idea: Can you replace only the line in your table which is in inline edit mode on pressing cancel without reloading the whole page.

Have a look at this great project. You will find examples, how to do this: GitHub - fractaledmind/hottable: A minimal Airtable clone built with Rails and HotWire

Thank you so much! Let me try