Fix rails4 asset_paths issues

This is the pull request for #2399, Please add comments there :)