Last Updated: February 25, 2016
·
438
· thomas el p

My Gem : css_grid

I made this awesome gem to use a css grid layout, and use it in a rails way.

I mean, css grid layout is really cool but it made you create so many divs. that far it's ok. But when its come to do each with your collections, if you want to use your User.all and do something fun in your view ... What a Pain !

So, using the 'cssgrid', I've made all the super-painfull stuff for you.
Guessing you want to Iterate trough all your users, and made a fine listing view with tree profile-a-row. You can either fight with 'in
groups_of' and 'each' and 'class=>"span4"'.

Or you can just call
<%= threecolcontainer :collection=>User.all do |user| %>
Name : <%= user.name %>
<%= end %>

There is a lot of options, :id, :class for created spans, :nested which is semi-automatic when you'r inside another row, :prepend and :append, and many more !

You can check the complete documentation on github : https://github.com/petrachi/css_grid

To use this gem, just add 'gem "css_grid" to your gemfile.
If you'r on Rails < 3, just read the doc, but feel safe, it's compatible.