First, create a new Cloudfront distribution via Amazon AWS console (gist here). Once you've done that, it's as simple as adding the following to your production environment (and staging if you run a staging environment), replacing the value with your CDN host url:
config.action_controller.asset_host = "<YOUR DISTRIBUTION SUBDOMAIN>.cloudfront.net"
See here for more info: https://devcenter.heroku.com/articles/using-amazon-cloudfront-cdn#adding-cloudfront-to-rails