Rails Gem “Axlsx” / “Rails-Axlsx” - Adding Image

前端 未结 3 746
甜味超标
甜味超标 2021-01-28 11:57

I try to add one image to my workbook/worksheet.

The Code :

    wb.add_worksheet(:name => \"Doc1\", :page_setup => setup, :print_options => opt         


        
3条回答
  •  佛祖请我去吃肉
    2021-01-28 13:00

    Here is another way you can achieve this:

    Code:

    img = File.open(Dir.glob("#{Rails.root}/app/assets/images/result.png, "r")
    

提交回复
热议问题