mampf
mampf copied to clipboard
Get rid of Rails UJS entirely in favor of Turbo
Follow-up to #801 (which was tackled in #824). I originally followed the Turbo Upgrade guide here. In the long run, we should try to get rid of Rails UJS entirely, such that we can totally focus on Turbo. This will also allow us to remove one further dependency.
Among others, we need to
- [ ] Remove the
app/controllers/concerns/turbo/redirection.rbfile that is currently used as a "shim" - [ ] Set
config.action_view.form_with_generates_remote_forms = false(it istrueright now) - [ ] Replace things like
data-method="post"by respective Turbo syntax - [ ] Replace
method: ...on links with Turbo syntax - [ ] Set
status: :unprocessable_entitywhen re-rendering the same page. This should be done in conjunction with a bigger shift in how we display form error messages (preferably inline, see my blog post on this). - [ ] Check if forms that expect
.js.erbneed adata-remote: trueflag (see here).
See this awesome blog post for more things we'd have to watch out for. Also this blog post.