mysterious-toddler-20573
12/04/2020, 5:35 PMmysterious-toddler-20573
12/04/2020, 5:35 PMbig-airline-13935
12/04/2020, 5:35 PMbig-airline-13935
12/04/2020, 5:38 PMhtmx.trigger(htmx.find('#form'), 'refresh')
for now, but those dozen saved characters would make me surprisingly happy 😉mysterious-toddler-20573
12/04/2020, 5:53 PMmysterious-toddler-20573
12/04/2020, 5:53 PMmysterious-toddler-20573
12/04/2020, 5:53 PMechoing-dress-67727
12/04/2020, 6:17 PMbutton_to
that runs a hx-post
, and that's working. The response swaps the button out, and the idea is that the button can be clicked again, over and over as many times as the user wants basically. But when I click it the second time after it's been swapped in, Rails gives me 422 InvalidAuthenticityToken
. The new request has the new authenticity_token
that was created in the response from the first click, and the cookie seems to be updated after the first request, so I assume it has the right new value in it, so as far as I can tell, everything is getting sent correctly, but I'm not quite sure. Anyone know what I might be missing?gorgeous-ghost-95789
12/04/2020, 6:30 PMgorgeous-ghost-95789
12/04/2020, 6:30 PMechoing-dress-67727
12/04/2020, 6:32 PMechoing-dress-67727
12/04/2020, 6:33 PMgorgeous-ghost-95789
12/04/2020, 6:37 PMmysterious-toddler-20573
12/04/2020, 6:42 PMechoing-dress-67727
12/04/2020, 7:14 PMechoing-dress-67727
12/04/2020, 7:14 PMechoing-dress-67727
12/04/2020, 7:15 PMgorgeous-ghost-95789
12/04/2020, 7:15 PMgorgeous-ghost-95789
12/04/2020, 7:16 PMgorgeous-ghost-95789
12/04/2020, 7:16 PMechoing-dress-67727
12/04/2020, 7:18 PMechoing-dress-67727
12/04/2020, 7:40 PMdocument.addEventListener('htmx:configRequest', (event) => {
const csrf_token = document.querySelector('[name="csrf-token"]').content
event.detail.parameters["authenticity_token"] = csrf_token
})
gorgeous-ghost-95789
12/04/2020, 7:41 PMechoing-dress-67727
12/04/2020, 7:42 PMgorgeous-ghost-95789
12/04/2020, 7:42 PMechoing-dress-67727
12/04/2020, 7:43 PMmysterious-toddler-20573
12/04/2020, 7:50 PMmysterious-toddler-20573
12/04/2020, 7:50 PMmysterious-toddler-20573
12/04/2020, 7:50 PMgorgeous-ghost-95789
12/04/2020, 7:52 PM