문제

I am using imgkit gem in my application to take snapshot of current page controller code is

kit = IMGKit.new(render_to_string)
t = kit.to_img(:png) 
file_path = '/home/myapp/file.png'
file = kit.to_file(file_path)

working fine(image save in myapp/file.png ).

Now my question

  • each time this method will overwrite file.png that i don't want
  • how can i display those saved images(suppose i give the saving path in images folder in my root app directory)

hope i explain my problem clearly, i am not using S3 for storing instead i am using my local machine

i am using https://github.com/csquared/IMGKit for my reference

도움이 되었습니까?

해결책

file_path = "/home/myapp/#{Time.now}file.png" should do it

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top