How Tailwind CSS Works with Rails

This is a premium course, which you can purchase below.

Buy Now

Tailwind CSS comes with its own compiler, and scans your template files for the Tailwind classes you're using. It does this for efficiency, but wow it can be confusing!


The Code

Running the site in development mode, ensuring that CSS gets compiled as we need:

bin/dev

Rendering a partial:

<%=render("directory/partial") %>

It's important to remember that partials start with an underscore, but you don't use it when you call render.
When defining a route, you start with the HTTP verb, the matcher, and then the controller#action pair:

get 'about', to: "home#about"