Le Wagon
Published in

Le Wagon

How to use .nil? .empty? .blank? .present? in Rails 6

Updated May 2020

Ruby methods can seem pretty daunting to a new programmer and knowing when to use which one can feel like a giant black hole. In this guide, I wanted to put together a quick cheatsheet for using some of the most common methods in Ruby and Rails — .nil? .empty? .blank? and .present?




Stories from our community on coding, product and entrepreneurship.

Recommended from Medium

Clean code — Name matters

The Truth On Trump’s Recent Firing Of My Father

JIRA Triggered Cloud Management

2nd week hw…

3D renders and JSON data for NFTs straight from Blender by using Python.

GummyBull, a social and decentralized dApps game

Mobile Cloud Computing (MCC)

Parse Azure ADLS Gen2 Audit logs using Spark

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Maria Schuessler

Maria Schuessler

Music Product @ TikTok | Former Full-Stack Dev | Editor of StirCrazy! Mag | Shanghai-based | blog.mariacodes.io

More from Medium

Building React.js App With Ruby on Rails API

Full stack web application-Simply Order with React and Ruby on Rails

How to include nested attributes in a Ruby on Rails post request

Create a Rails API with React Frontend using Hooks and TypeScript