Page.rb
has_many :comments, :dependent => :restrict
This validation raises
PagesController# (ActiveRecord::DeleteRestrictionError) "Cannot delete record because of `dependent comments"`
Is there a way to show it like a flash message or with other validation messages.?
Use begin/rescue to catch that exception and then add the error message to the base errors for page… my syntax is off, but something like…