Easy grid tables and forms using pivot_table

One of the most frequently requested features I’m faced with is the ability to display tabular data in a grid which resembles an Excel pivot table. If you’re not familiar with the pivot table concept, take a look here.

I have yet to find a gem that makes this easy, so I’ve created my own. Introducing pivot_table.

The gem is self-explanatory, but still fairly young, so feel free to fork and update to suite your own needs.

Here’s a screenshot of what you can easily accomplish with this gem.

The gem will evolve along with my application’s needs, but I’d appreciate any additional help or feedback.

Simples.

Advertisements

7 thoughts on “Easy grid tables and forms using pivot_table

  1. Hi!, i’m begginer in ruby on rails, and i try to use pivot_table gem but i don’t understand how to use it, i don’t know if you have a tutorial or another information, thanks a lot

  2. Is there any way you may provide a working example of this? I’m also new to RoR, and I’m really not too sure what to do.

    Any help is greatly appreciated.

    1. Hi, for a working example please see the GitHub code repo. The README is well-documented with working code samples. I’ve also just pushed version 0.2.0.

  3. A neat and helpful gem. Is there a limit in the number of records in the table to pivot? I am using a table with 24K+ rows (before pivot build) and the build process seems to take a long time. Just wonder if there is any way to speed things up during the build process. Thanks

    1. Hi Steve, I honestly haven’t tested the gem with such a large dataset. I’m typically using around 200-300 rows and the performance is fine. If you have 24k rows then I’d recommend you either aggregate you data prior to using the gem, or possibly reduce the amount of data you are presenting – 24k rows seems to me to be too big to easily present as a grid.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s