Add conditional class names
If you want to conditionally add class names in Rails, here is a clean way to do it.
This takes advantage of the class_names
method, which is just an alias for the token_list method.
h/t to Matt Polito.
I always find myself looking up his TIL and figured if I make it myself it will help me retain it. 😅