-1

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?

marcsqna09
  • 117
  • 1
  • 2
  • 9

1 Answers1

0

<%= 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)

obiruby
  • 379
  • 1
  • 6