On Github jxandery / handling-errors-intro
rescue ActiveRecord::RecordNotFound # you put your code here to rediret end
Clone this repo. https://github.com/itechdom/class-rails-handling-errors-failures
Look under the examples folder
Create a staging.rb file in the environments folder.
Copy the contents of the production.rb.
Set the config.log_level to debug.
Add staging to Gemfile
Add the database configuration for the staging server.
Set the staging database:
RAILS_ENV=staging rake db:migrate
RAILS_ENV=staging rake assets:precompile
get '*path', :to => 'errors#show'