Skip to content

Instantly share code, notes, and snippets.

@Agowan
Created May 7, 2015 08:33
Show Gist options
  • Save Agowan/aea01ae16466ec915490 to your computer and use it in GitHub Desktop.
Save Agowan/aea01ae16466ec915490 to your computer and use it in GitHub Desktop.
carrier wave file
def data
@data ||= File.read pdf_template_path
end
def pdf_template_path
@tmp_path ||= @pdf_template.template.tap { |u| u.cache_stored_file! }.path
end
def cleanup
File.delete(pdf_template_path) if File.exist?(pdf_template_path)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment