I like using TailwindCSS and Rails. However, many times I want to make a change on the default generator, such that rails generate scaffold conform to the theme of the rest of the application.

Unfortunately, that option isn’t available (yet).

Reverse-engineering from the setup that made tailwindcss-rails gem take control of scaffolding, I managed to find a quick and dirty solution. Let’s walk through it.