Ruby Prawn如何在两列中显示图像

时间:2014-04-15 21:12:47

标签: ruby-on-rails ruby prawn

我有一系列图片,我想迭代并在2列表中显示如下:

enter image description here

但到目前为止我得到了这个:

enter image description here

使用此代码:

@conclusion.assets.each do |f|
  image f.picture.path
  move_down 10
end

1 个答案:

答案 0 :(得分:2)

耶!让它工作,代码:

column_box([0, cursor], columns: 2, width: bounds.width) do
  @conclusion.assets.each do |f|
    image f.picture.path
    move_down 10
  end
end