Simple Ruby class to print ActiveRecord results as a table
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, ...
blog.96codes.dev3 min read