My project's server-side scaffold forms will not redirect to the next page. (from new->show with flash message). Although the content from the form is saved and a new record saved. (not sure how?)
When i comment out the lines, in application.js in works as normal, submits, redirects to show
import Rails from "@rails/ujs" Rails.start()
form code is
<%= form_with(model: content_asset) do |form| %>
but form has
data-remote=true
So it looks like trying to do ajax with default scaffold code, how can i prevent this?
<%= form_with(model: content_asset, local: true) do |form| %>
(assuming you are using rails 6.0 where by default form submits are remote and unobtrusive XHRs... in rails 6.1 this default was reversed)
2.1m questions
2.1m answers
60 comments
56.8k users