lib/wisepdf/helper.rb in wisepdf-1.2.5 vs lib/wisepdf/helper.rb in wisepdf-1.2.6

- old
+ new

@@ -39,10 +39,14 @@ </style>" }.join("\n").html_safe end def wisepdf_image_tag(img, options={}) - image_tag "file:///#{::Rails.application.assets.find_asset(img).pathname.to_s}", options + if File.exists? img + image_tag "file://#{img}", options + elsif asset = ::Rails.application.assets.find_asset(img) + image_tag "file:///#{asset.pathname.to_s}", options + end end def wisepdf_javascript_tag(*sources) sources.collect { |source| filename = ( source =~ /.js\z/ ? source : source + '.js' ) \ No newline at end of file