---
title: "Discussion on \"Simple Ruby class to print ActiveRecord results as a table\" | Hashnode"
description: "Discussion on \"Simple Ruby class to print ActiveRecord results as a table\". You ever wanted to print a result of records in a fancier way?\n With this simple class  you can print tables like this:\nrecords = Post.includes(:user).where(user_id: [1,2])\nattributes = [:created_at, :title, {user: :name}]\n\nTablePrinter.new(records, ..."
url: "https://hashnode.com/posts/simple-ruby-class-to-print-activerecord-results-as-a-table/60424de331ae032b9f3e91a5"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Simple Ruby class to print ActiveRecord results as a table](https://blog.96codes.dev/simple-ruby-class-to-print-activerecord-results-as-a-table?utm_source=hashnode&utm_medium=feed)

You ever wanted to print a result of records in a fancier way? With this simple class you can print tables like this: records = Post.includes(:user).where(user\_id: \[1,2\]) attributes = \[:created\_at, :title, {user: :name}\] TablePrinter.new(records, ...

Mar 5, 2021 · 3 min read · blog.96codes.dev  
Read the article

-   [#ruby](https://hashnode.com/tag/ruby)
-   [#ruby-on-rails](https://hashnode.com/tag/ruby-on-rails)

## Written by

[Benjamin Silva Herrera](https://hashnode.com/@silva96)

@silva96 · Santiago, Chile

  
[View profile](https://hashnode.com/@silva96)

Software Engineer and Father. Love to learn, love to teach, love to build. CTO at recorrido.cl -> Ruby, Elixir, Vue / Stimulus

My name is Benjamín Silva, I studied Computer Science. I try to keep up to date on technologies and best practices and this blog is a personal project that hopefully helps me on that. I believe making myself write tech stuff is a good way to share my knowledge at the same time keep me learning new things. What I'm using on my daily work: Elixir (and Phoenix), Ruby on Rails, Rspec, PostgreSQL, Vue.js, Elasticsearch, AWS, Docker What else I know or I used before: Android Native, React, Python Django

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
