Updating PR #460 to Rails4

Merging with upstream and updating #460 with changes to the Rails 4 asset-pipeline