Fixing the mysterious “Element script is missing required attribute src” error

Suppose you're using the W3C validator to validate HTML5. Here's a sample document: <!doctype html> <html lang="en" xml:lang="en"> <head> <meta charset="utf-8" /> <title>Hello</title> <script type="text/javascript" charset="utf-8"> //<![CDATA[ var foo = 1; //]]> </script> </head> <body> </body> </html> Everything looks right, but you get this mysterious error: Line 6, Column 48: Element script is missing required …

Handling Rails errors: custom error pages, logging, notification

I wanted to improve error handling In my Rails applications. Specifically, I wanted three things: a custom error page that matched the site's design the errors to appear in the error log (production.log) email notification of server errors Note: these steps are for Rails 2.3.2–2.3.8. Other versions may require different instructions. Custom error page Normally, …