Tutorial: Duplicate rows in ActiveScaffold subforms
Subforms often contain rows that are almost identical. ActiveScaffoldDuplicate 2.0 lets users copy an existing row, edit only the values that differ, and save everything with the parent form.
Our new Duplicating rows in subforms tutorial shows how to add the Duplicate link to a collection subform with one configuration option:
config.columns[:lines].form_ui = nil, { duplicate: true }It also explains when the new row is saved and how to override duplicate_subform_row to clear unique fields or recalculate values after the row is copied.
The feature requires ActiveScaffold 4.2 or newer and ActiveScaffoldDuplicate 2.0. Read the complete tutorial to get started.
