nil?, empty?, blank? in Ruby on Rails - what's the difference actually?

This is convenient for web applications because you often want to reject or handle differently string which contain only invisible spaces.

  • The logic for every other class is that if it implements empty? then that’s what going to be used. It’s interesting to see that the method and its behavior was documented fully here.

nil?, empty?, blank? in Ruby on Rails - what's the difference actually? #ruby #rubydeveloper #rubyonrails https://rubyonrails.ba/single/nil-empty-blank-in-ruby-on-rails---whats-the-difference-actually

Nezir Zahirovic

Contractor Ruby On Rails (8+ years) / MCPD .Net / C# / Asp.Net / CSS / SQL / (11 years)

related articles