I used to use rails-sprockets
2.x and was using the following in an email layout template to include the css
Rails.application.assets.find_asset('file').to_s.html_safe
However, this no longer works in rails-sprockets
3.x and it is suggested to use
Rails.application.assets_manifest.assets['file.css']
This only returns the string name of the file (if it exists). How would I get the body of the file so I can output it in the view?
I just ran into this issue too, although I upgraded to sprockets 3.x about 7 months.
I threw this together as quick as I could (there is likely a better solution out there...) - this will get you the path name - just use
File.read()