I have the following code:
<% for month in @months %>
<%= render(:partial => “month” , :object => month) if month %>
Calendar year, 2006 is only partially complete–the first record is
October 16, 2006. Therefore, I only want rails to render the partial if
month is not nil. @months-@months are nil. However the code
above does not work.
What is the correct code to check and see if the array, month is not a
nil object before rendering the partial?