Rails 2.3 : Object#try
you can avoid nil-checking
@person.try(:name) # @person ? @person.name : nil @people.try(:collect) {|p| p.name} Person.try(:find, 1) Product.find_by_price(4.95).try(:name)
Ruby on Rails 2.3 Release Notes - 7.1 Object#try
Class: Object
Railscasts - Rails 2.3 Extras