Handle active record erros

class Product < ActiveRecord::Base
def self.find(*args)
begin
super args
rescue ActiveRecord::StatementInvalid => error
raise “Sorry!”
end
end

With this i can display in the exception page whatever i want…but
my problem is that i just want the message “Sorry!” in my template
without using rails exception page.

Thanks

Claudio

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs