Forum: Ruby on Rails testing for empty columns

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
66d1d0df01e4bbb82674a353ea68d6ee?d=identicon&s=25 Josh Kieschnick (jjkiesch)
on 2006-05-08 20:46
i almost feel dumb for even asking this one, but i can't seem to figure
it out.

i just need to test for an empty variable. i've tried:

<% if object.value
  do_something_here
end %>

but it always evaluates to true, even if the variable is empty.
66d1d0df01e4bbb82674a353ea68d6ee?d=identicon&s=25 Josh Kieschnick (jjkiesch)
on 2006-05-08 21:10
figured it out. nvm.

i used "object.value.nil?"
This topic is locked and can not be replied to.