ruby-on-railsruby-on-rails-4paperclipimgkit

imgkit snapshot saving issues rails 4


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

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


Solution

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