Checkout Rails guides about asset pipeline and how to include assets from ruby gems:
http://edgeguides.rubyonrails.org/asset_pipeline.html#adding-assets-to-your-gems
Adding Assets to Your Gems
Assets can also come from external sources in the form of gems.
A good example of this is the jquery-rails gem which comes with Rails as the standard JavaScript library gem. This gem contains an engine class which inherits from Rails::Engine. By doing this, Rails is informed that the directory for this gem may contain assets and the app/assets, lib/assets and vendor/assets directories of this engine are added to the search path of Sprockets.