Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #3 from mhourahine/master

Changing from RAILS_ROOT to Rails.public_path
  • Loading branch information...
commit 75146519ed7fde0ab43650ba29b33a77e5d9e706 2 parents 078e81f + 28388d1
@jstewart authored
View
6 lib/ezprint/processors/pdfkit.rb
@@ -12,9 +12,9 @@ def self.process(html_string, options = {})
def self.process_html(html)
# reroute absolute paths
- html.gsub!("src=\"/", "src=\"#{RAILS_ROOT}/public/")
- html.gsub!("href=\"/", "src=\"#{RAILS_ROOT}/public/")
- html.gsub!("url(/", "url(#{RAILS_ROOT}/public/")
+ html.gsub!("src=\"/", "src=\"#{Rails.public_path}/")
+ html.gsub!("href=\"/", "src=\"#{Rails.public_path}/")
+ html.gsub!("url(/", "url(#{Rails.public_path}/")
html
end
end
View
6 lib/ezprint/processors/prince.rb
@@ -25,9 +25,9 @@ def self.cmd(options)
def self.process_html(html)
# reroute absolute paths
- html.gsub!("src=\"/", "src=\"#{RAILS_ROOT}/public/")
- html.gsub!("href=\"/", "src=\"#{RAILS_ROOT}/public/")
- html.gsub!("url(/", "url(#{RAILS_ROOT}/public/")
+ html.gsub!("src=\"/", "src=\"#{Rails.public_path}/")
+ html.gsub!("href=\"/", "src=\"#{Rails.public_path}/")
+ html.gsub!("url(/", "url(#{Rails.public_path}/")
html
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.