<% day = 0 %> <% current_day = DateTime.current.strftime('%j').to_i %> <% comments.each do |comment| %> <% comment_day = comment.created_at.strftime('%j').to_i %> <% if comment_day <= current_day && comment_day > day %> <% day = comment.created_at.strftime('%j').to_i %>
  • <%= comment.created_at.strftime('%d.%m.%Y') %>

  • <% end %>
  • <%= render 'step_comments/comment.html.erb', comment: comment %>
  • <% end %>