From 5fe2009bd97d1f300d4764e6273ba9c28c588327 Mon Sep 17 00:00:00 2001 From: Zee Spencer <50284+zspencer@users.noreply.github.com> Date: Thu, 21 Dec 2023 13:36:39 -0800 Subject: [PATCH] Show `better_errors` even when using Turbo I've enjoyed using Turbo in my Ruby projects. What I haven't loved is the opaque `Content Missing` error that pops up when a Turbo-wrapped request throws an error. Sure, I can right-click and dig into the request panel on my developer tools; and I do... But wouldn't it be nice if instead of all that nonsense; errors would render directly to the screen; so I can read them with my lazy eyeballs rather than having to use my clicky-clicky-fingers? Anway, this adds [a header to the better errors layout](https://turbo.hotwired.dev/reference/attributes#meta-tags) which tells turbo exactly where to shove the content of this error page. Right up our eyeballs. --- lib/better_errors/templates/main.erb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/better_errors/templates/main.erb b/lib/better_errors/templates/main.erb index 37dc30de..51c62783 100644 --- a/lib/better_errors/templates/main.erb +++ b/lib/better_errors/templates/main.erb @@ -3,6 +3,7 @@ <%= exception_type %> at <%= request_path %> + <%# Stylesheets are placed in the for Turbolinks compatibility. %>