Custom Error Pages in Ruby on Rails
Web-Crunch
Hi, My name is Andy Leverenz and I work as a product designer and developer. For fun, I design, code, and write. Check out my blog called Web-Crunch https://web-crunch.com where I publish design and development tutorials with the occasional vlog.
==================== ⚙️Github repo: https://github.com/justalever/dynamic_errors
Ruby on Rails ships with default error pages for more popular requests you might encounter including 404, 500, and 422. Each request has an associated static HTML page that lives inside every new Ruby on Rails app's public directory.
There may come a time where those static pages are a bit cumbersome to work with or you want to add a little more flair to yours using assets that already exist in your app. The public folder by design lives outside of the bound of what Rails and serve so you will see that each html page has embedded styles and content.
This works for basic error pages but in my own case, I wanted to leverage Tailwind CSS that I was already using inside my application. We can do this in a few steps but that means tweaking some configuration and telling your app how to handle errors in a new custom way.
Read the full blog post here: https://web-crunch.com/posts/custom-error-page-ruby-on-rails
♥️ Sponsor me on GitHub https://github.com/sponsors/justalever
☕️ Keep me awake. Buy me a coffee https://www.buymeacoffee.com/webcrunch
📰 One-Click Subscribe: https://www.youtube.com/user/webcrunchblog?sub_confirmation=1
💻 Previously published at: https://web-crunch.com/posts/how-to-super-charge-your-new-rails-app-workflow
💎Latest course: HELLO RAILS https://hellorails.io
💻 Check out the blog: https://web-crunch.com
🦄 Check out my personal site: https://justalever.com
🚀 Links: Weekly Newsletter: https://digest.web-crunch.com/ Twitter: https://twitter.com/webcrunchblog Github: https://github.com/justalever
📘Check out my book on UX Design: "LUXD: Learn User Experience Design" https://web-crunch.com/products/luxd
📙 Check out my FREE book on Tumblr Theming: "Pro Tumblr Theming" https://web-crunch.com/products/ptt
💎 Ruby on Rails devs, Try HatchBox.io. You'll save upwards of 50% compared to Heroku. I use it and love it! https://hatchbox.io/?via=hellorails
💯 Need awesome web hosting? Check out cloudways. They allow me to use a variety of hosting providers and build apps with ease: http://bit.ly/webcrunchhosting
🌊 Need more advanced hosting for Rails, PHP, Node, or other projects? Digital Ocean has you covered. https://m.do.co/c/ee243ee15648 ... https://www.youtube.com/watch?v=_laCIdQmOr4
34285304 Bytes