Posted By

wackimonki on 02/26/07


Tagged

rails empty rubyonrails


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

maxkks
webstic
imouaddine


Testing If Variable is Empty (nil)


 / Published in: Ruby
 

The code tests if session[:counter] exists. If you leave out the all important '?', it will fail with an error.

  1. if session[:counter].nil?
  2. # code here
  3. end

Report this snippet  

You need to login to post a comment.