В текущей версии Prawn 0.12.0
невозможно встроить изображения в Prawn::Table
, но эта функция, кажется, реализуется, см. здесь . На данный момент вы должны написать свою собственную таблицу, что-то вроде
data = [[{:image => "red.png"},{:text => "Red"}],
[{:image => "blue.png"},{:text => "Blue"}]]
data.each_with_index do |row,i|
row.each_with_index do |cell,j|
bounding_box [x_pos,y_pos], :width => cell_width, :height => cell_height do
image(cell[:image], ...) if cell[:image].present?
text_box(cell[:text], ...) if cell[:text].present?
end
x_pos = (x_pos + cell_width)
end
y_pos = (y_pos - cell_height)
end