test for last row in object

Seems my code is wrong here on the first line, anyone can help

unless p==@posts.last

somevariable << ", "

end

Seems my code is wrong here on the first line, anyone can help

unless p==@posts.last

Are you expecting that to check all the attributes of p and @posts.last and see if they are the same?