Bootstrap flash messages in Rails
After avoiding Bootstrap for so long, I’m starting to see some of the advantages that it offers. For instance, I needed to style flash messages today, and turn out, I don’t have to write any CSS for it. This is all the code I needed:
Then we add a simple helper method to translate the flash classes to the bootstrap flash class names:
Maybe it’s not such bad idea to start new projects with Bootstrap after all.
Tags: rails