In a Rails application, unnecessary images/CSS/JS will affect application load time and also stretch the deployments.

In one of our projects, we had over 1500+ images. This was making our life difficult; especially “asset precompile”. It was very difficult to find images which were not in use.

Here is a small ruby script to find all unused images and get rid of unused images:

Run above script on rails console to remove all unused files.

Hope this helps!

Click here for more details…

At BoTree Technologies, we build enterprise applications with our RoR team of 25+ engineers.

We also specialize in RPA, AI, Python, Django, JavaScript and ReactJS.

Consulting is free – let us help you grow!