Initial line item idea

This commit is contained in:
2026-03-01 15:04:25 -05:00
parent b95a3b6623
commit eb6beea5fa
12 changed files with 2716 additions and 28 deletions

View File

@@ -0,0 +1,19 @@
(function() {
class NestedFormController extends Stimulus.Controller {
static targets = ["container", "template"]
add(event) {
event.preventDefault();
const content = this.templateTarget.innerHTML.replace(/NEW_RECORD/g, new Date().getTime());
this.containerTarget.insertAdjacentHTML("beforeend", content);
}
remove(event) {
event.preventDefault();
event.target.closest(".nested-fields").remove();
}
}
// Expose globally so index.js can access it
window.NestedFormController = NestedFormController;
})();