Suggestion: Allow tweaking or overriding the view (theme)

Author: DannyBenCreated Aug 31, 2015Updated Feb 16, 2023
Labelsenhancement

It would be nice if there was an option to either completely customize the better_errors page, or maybe at least just to tweak it (whichever is easier to implement).

Tweaking approach for example: Enable some settings that can be placed in the initializer to set some colors, and font size. Specifically, I would like to change the colors of the black header and increase font size a little.

Overriding view: This can be done in several ways I guess, one that I saw elsewhere that was working nicely, is to add a generator (like rails generate better_errors:views) that will generate view files in the views folder, and then anyone can tweak as they want.

EDIT: I just noticed that there is a commented out light theme section in the main template, so someone has already done half the work. I tried doing the other half of allowing it to be configurable, but realized I am in over my head... didn't know what is the proper way to pass variables from the middleware to the template (tried with env but realized I am doing something wrong...).

For now, I just commented out this block in my form

Source: BetterErrors/better_errors