TAGS:

ruby  rails  exception  handler 

Series:

Dealing with Missing Layout.

We know that the default error pages in the public folder has no layout, But in rails exception handler it uses layout, so What we can do if layout is missed.

For this reason, rails exception handler provide

#config.fallback_layout = 'home'

in /config/initializers/rails_exception_handler.rb/

Uncomment it and change home layout to be another one as error in our tutorial.

As shown in this tutorial video :


Source on github.com

Great Note, Every time you change any file in config/initializers, You must restart server.