Rails console is the type of tool that we, as Rails developers, heavily use in production and development environments for any type of the apps. Besides interacting with the database to read or manipulate records, there are plenty of other use cases where you can find the Rails console useful.
You can even personalize the console for the given project to increase the ease of usage and efficiency. In this article, I will present all the more and less known console features you can use to interact with the database and code in your project.
I wouldn’t say that working with the Rails console is uncomfortable, but let me share with you a few tips that make the work even easier and more comfortable.
Depending on the actions that you perform on the database and the nature of your data, a lot is going on in logs when making the queries:
When you use puts inside your code to monitor the progress or just debug some parts of the process, it’s easy to lose track of them among the logs. You can silence the logs by wrapping the code inside the special block: