Hi, this blog is no longer maintained, my new blog is here

Ruby On Rails and a Conning Israeli entrepreneur

Rails nil, null empty or blank object

From the rails Ruby Object extenstion, The Object#blank? is now covering nil, blank and empty responses.

so:

elad = nil
elad.blank? # true
and even empty containers
elad = []
elad.blank? # true

note: Remember that this is a Rails extension to Ruby's Object, so it will not work on IRB, but will on console

0 comments:


The Web Ask eizesus.com

Subscribe

    follow me on Twitter

    Twiters Around

    About Me

    My photo
    I am a web developer for more than 9 years, managed, cried, coded, designed and made money in this industry. now trying to do it again.

    Blog Archive

    Labels