我试图这样编码。
这有什么问题?
def topic_button(community)
if !community.topics.order("last_active_at DESC").last.nil? && community.topics.order("last_active_at DESC").last.last_active_at.to_date == Date.current.to_date
'posted today'
else
'no post today'
end
end