Update an error summary area via turbo_stream.update

3898
0

For forms with multiple fields, I like an error summary at the top. With Turbo Streams, you can update just the summary target when validation fails. This is helpful when the form is long and the user might not see inline errors immediately. The server template can render a concise list of messages and link to fields via anchors. I pair this with status: :unprocessable_entity so Turbo doesn’t treat the response as a successful navigation. A good UI pattern is: replace the form (so fields show errors) and separately update the summary container. Doing both keeps things accessible and clear. This also works nicely for inline edit forms: only the affected row shows errors, not the whole page.