View: why nil check not working as it should?

before i print the contents of my instance i do this

<% if @viewobj != nil %>
something…
<%end%>

and do this if its nil

<% if @viewobj == nil %>
print empty
<%end%>

but its not working?

i also tried @viewobj.empty? and @viewobj.blank?

how do i print out a message in my view that states its empty?

Are you sure @viewobj is nil? Use debug(@viewobj) to make sure.

thanks for that cool tip. i see now that even though my object what i
was looking for is nil, since it "belongs to’ another class, it picks up
the parents attributes…