From d997834842cc688e6abcbd29999a57190baefb0a Mon Sep 17 00:00:00 2001 From: Carson Gross Date: Thu, 2 Jun 2022 10:19:39 -0600 Subject: [PATCH] make edit row demo edit the correct row :| fixes https://github.com/bigskysoftware/htmx/issues/934 --- www/examples/edit-row.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/examples/edit-row.md b/www/examples/edit-row.md index 7b9e92a7..92bdfbf4 100644 --- a/www/examples/edit-row.md +++ b/www/examples/edit-row.md @@ -142,7 +142,7 @@ this makes things a bit nicer to deal with. }); onPut(/\/contact\/\d+/, function(request, params){ - var id = parseInt("/contact/0/edit".split("/")[2]); // get the contact + var id = parseInt(request.url.split("/")[2]); // get the contact contact = contacts[id] contact.name = params['name']; contact.email = params['email'];