You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When i submit a form with Turbo 8 which fails validation, the reponse HTML is never being rendered and therefore it never shows the flash message. In the console i see the following JS error:
defcreate@task=Task.new(task_params)if@task.saveredirect_totasks_path,notice: "#{@task.name} was created."elseflash.now[:error]=@task.errors.full_messages[0]render:new,status: :unprocessable_entityendend
with model validation
validates:name,presence: true
and the form
<%= form_with model: @task do |f| %><divclass="row"><divclass="col-12 col-md-6"><divclass="form-group"><labelclass="form-label">
Name
</label><%= f.text_field :name, class: "form-control" %></div></div><% end %>
The issue occurs if i submit the form while leaving the name blank. Using render :new, status: :see_other instead, gets rid of the error but the HTML is still not being replaced and therefore the flash message not shown
The text was updated successfully, but these errors were encountered:
When i submit a form with Turbo 8 which fails validation, the reponse HTML is never being rendered and therefore it never shows the flash message. In the console i see the following JS error:
which points to this function
My code
Given the following controller create action
with model validation
and the form
The issue occurs if i submit the form while leaving the name blank. Using
render :new, status: :see_other
instead, gets rid of the error but the HTML is still not being replaced and therefore the flash message not shownThe text was updated successfully, but these errors were encountered: