Created
February 6, 2013 02:37
-
-
Save raws/4719762 to your computer and use it in GitHub Desktop.
Precompiled static error pages written in Haml using Rails 3's asset pipeline
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
| Rails.application.assets.register_engine '.haml', Tilt::HamlTemplate | |
| config.assets.register_mime_type 'text/html', '.html' | |
| config.assets.paths << Rails.root.join('app', 'views', 'errors') | |
| config.assets.precompile += %w(404.html 500.html) | |
| config.exceptions_app = ActionDispatch::PublicExceptions.new(Rails.root.join('public', 'assets')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Did you get this to work with the Rails 4.1 assets pipeline? My 404 and 500 pages get precompiled with a assets hash in their filename. Therefore
ActionDispatch::PublicExceptionscannot find them (it looks for500.htmlinstead of500-some_hashtag.html). So now I move these files after asset precompilation. It would be nice though if that would not be necessary.