Use Rails try to handle nil value