Skip to content

Instantly share code, notes, and snippets.

@sllvn
Last active December 12, 2015 01:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sllvn/4693484 to your computer and use it in GitHub Desktop.
Save sllvn/4693484 to your computer and use it in GitHub Desktop.
def display_name
name = self.name
name = "N/A" if name.blank? or name.nil?
name
end
@sllvn
Copy link
Author

sllvn commented Feb 1, 2013

(self.name.nil? or self.name.blank?) ? "N/A" : self.name

Is this best? Seems ugly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment