I am using Rails 2.3.5 and in that if I give Model.find(1)
and if 1 is not in the database, it returns ActiveRecord error. Should it just be returning nil
throwing the exception is the expected behavior.
in fact in the normal course of events if you let the exception go unhandled your rails server will return the proper 404 page not found error.
if you'd like for it to return nil you can catch it yourself:
begin
@model = Model.find(id_provided)
rescue ActiveRecord::RecordNotFound => e
@model = nil
end