Open Mirv opened 7 years ago
class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
# This might need to be rescue => e at some point
rescue_from ActiveRecord::RecordNotFound, :with => :record_not_found
Options:
Model.first
and seed all tables with "Default" so uses know something went wrong to avoid error handlingActiveRecord::RecordNotFound
& reroute back to referring page with flash message?
Instead of rescuing exception on the application_controller I need to implement
Before_validation
... bit of it shown here but research what else is needed...http://guides.rubyonrails.org/v2.3.11/activerecord_validations_callbacks.html#callbacks-overview