开发者

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]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜