How to use FontAwesome 5/6 with Rails 7 and Propshaft

Using FontAwesome with Rails was really easy with font-awesome-rails gem. It also had really nice helpers. Thing is this gem depends on Sprokets. I wanted to try the shiny but very light Propshaft to be inline with modern Rails.

Read any YAML config file in Rails with ease

Few days ago I stummbled upon a cool helper method in Rails called config_for. It's super useful to read any YAML based config files with ease. Let me show you.

Live preview Rails Mailer templates while developing

Developing email templates and sending a new mail every time to view a change is very inefficient and painful. Rails comes in rescue again. With mailer preview, you can view the changes in your browser just like any other page template.

How to change table for Rails models on the fly

Maybe you need your multi tenant application database to partition horizontally (shard). Probably you want to store different customers data in different tables.