Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module AssetsHelper
- def inline_file(path)
- if assets = Rails.application.assets
- asset = assets.find_asset(path)
- return '' unless asset
- asset.source
- else
- File.read(File.join(Rails.root, 'public', asset_path(path)))
- end
- end
- def inline_css(path)
- "<style>#{inline_file path}</style>".html_safe
- end
- end
Add Comment
Please, Sign In to add comment