Rails4: please, give any example to add_image

139 views
Skip to first unread message

FromRussia

unread,
Dec 31, 2013, 8:25:55 AM12/31/13
to ax...@googlegroups.com
I'm a newbie to this gem.

Having in the view 'show.xlsx.axlsx':
...
img = Rails.root.join("app/assets/images/demo.jpg").to_s
sheet.add_image(:image_src => img, :noSelect => true, :noMove => true, :hyperlink=>"http://axlsx.blogspot.com") do |image|
image.width=720
image.height=666
image.hyperlink.tooltip = "Labeled Link"
image.start_at 0, 0
end
...
It creates a XLSX-file, which I couldn't open without deleting some components in it. Other content is fine in the created file except the added image.

Could anybody give an example of adding an image to XLSX-file?

Reply all
Reply to author
Forward
0 new messages