Error

Encountered a syntax error while rendering template: check

Solution

@chats.order (created _at: :d esc) .each do |chat| just before each It turns out that there was no period, so the code has been corrected to resolve the error.