Created
January 5, 2015 16:59
-
-
Save BRMatt/aa383c6168f3e0abdd8f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Whoops, 404! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rake::Task['assets:precompile'].enhance do | |
assets_path = File.join(Rails.public_path, "assets") | |
Dir[File.join(assets_path, '*.html*')].each do |matched_asset_path| | |
http_status_code, extension = /#{assets_path}\/([0-9]{3})[^\/\s]*(\.html.?[^\b]*)/.match(matched_asset_path).captures | |
error_page_path = File.join(Rails.public_path, "#{http_status_code}#{extension}") | |
cp matched_asset_path, error_page_path | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
config.assets.paths << "#{Rails.root}/assets/html" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment