Guest User

Untitled

a guest
Oct 19th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. module AssetsHelper
  2. def inline_file(path)
  3. if assets = Rails.application.assets
  4. asset = assets.find_asset(path)
  5. return '' unless asset
  6. asset.source
  7. else
  8. File.read(File.join(Rails.root, 'public', asset_path(path)))
  9. end
  10. end
  11.  
  12. def inline_css(path)
  13. "<style>#{inline_file path}</style>".html_safe
  14. end
  15. end
Add Comment
Please, Sign In to add comment