Ruby on Rails user list columns
I was wondering how I could go about creating a list of users four columns wide?
Right now each user is jus开发者_JAVA技巧t printed on a single row with a division.
Thank you.
I suppose you are looking for a Rails solution and not an CSS one? Think you can do this both in CSS and Rails.
Do you want something like this (see here for more examples)?
@users.in_groups_of(4) {|user| user.name}
["Tony", "John", "Frank", "Bill"]
["Dave", nil, nil]
精彩评论