Render Turbo Frame Upon Form Submit

Since you’re not using Turbo Streams. The controller returns an html partia, i.e ending with .html.erb. Turbo then expects the controller to redirect.

You need to specify the frame to replace on the form itself. See Turbo Reference (hotwired.dev)

  <%= form_with url: loan_calculator_quotes_path, data: { turbo_frame: : loan_option} do |form| %>

Also, it seems that your turbo frames don’t have matching id. On in the form has lease_option and the partial has loan_option. Frames need to have a matching id in order to replace themselves

3 Likes