You can use to_s function to replace NIL to empty string.
For example, you can put following code in your view.
<%= obj.to_s %>
If obj is NIL, it simply returns “” (empty string), and you can avoid
Thanks, however using to_s removes the structure of the array on display
and concats the whole array into a single string.
testarray = [[“one”, nil, “three”],
How can I get this so that the ouput is displayed as:
So that it can deal with generic objects containing nil items.