I want to check when my object @objectname
is not equal to null to show the values of the @objectname
else to show that no values found.
I tried this:
<% if (@objectname != null) then %>
but I'm getting an error.
it's nil
in Ruby, not null
. And it's enough to say if @objectname
to test whether it's not nil. And no then
. You can find more on if
syntax here:
http://en.wikibooks.org/wiki/Ruby_Programming/Syntax/Control_Structures#if