I’m looking for a clean and simple way to print in the Rails Console the contents of my 5 row database with 2 columns.
Any ideas? I Googled around but didn’t find much.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I think you should first use the hirb gem which provides a very pleasant way to print your tables columns.
gem install hirbgem 'hirb'rails cEnable hirb in the console:
If you want to limit the number of rows to display, you can do:
For instance:
You can also specify the fields that you want to display using select: