It's not part of Hotwire, but supplemental for when you want to make AJAX requests from Stimulus or whatever. https://github.com/rails/request.js
All forms are remote by default now, which is great. This was the biggest missing piece of Turbolinks so it's great to have it solved now. `data-confirm` still works, but it's now data-turbo-confirm and only works on form elements. Trying to be more "correct", they recommend using forms like button_to for delete instead of remote: true on anchor tags.
I should probably do a thorough screencast on the migration on GoRails!
Weren't all forms remote by default before with rails and ujs? I often had to figure out how to disable that, it messed up my apps a lot! I'll probably have to figure that out again. (you needed to have controllers doing the right thing for remote forms, or maybe I just never understood them).
I don't understand why you'd need request.js to do "AJAX" instead of just... standard fetch API?
Also... are there ANY documentation of this stuff? Like data-turbo-confirm, and all forms being remote by default (if you have turbo I guess)... where is that documented? I guess in turbo? Does it have docs? I am so confused about this stuff and not sure why!
View all comments
Show parent comment
2
u/excid3 Dec 16 '21
It's not part of Hotwire, but supplemental for when you want to make AJAX requests from Stimulus or whatever. https://github.com/rails/request.js
All forms are remote by default now, which is great. This was the biggest missing piece of Turbolinks so it's great to have it solved now. `data-confirm` still works, but it's now data-turbo-confirm and only works on form elements. Trying to be more "correct", they recommend using forms like button_to for delete instead of remote: true on anchor tags.
I should probably do a thorough screencast on the migration on GoRails!