From 0ac5950f8c50bfcb6ce6cd89c0e80d982513cd15 Mon Sep 17 00:00:00 2001 From: David Gay Date: Tue, 6 Jul 2021 20:11:20 -0400 Subject: Increase chat message area chat message limit from 100 to 200, and add a chat history page that shows the last 2,000 messages --- app/controllers/chat_messages_controller.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'app/controllers') diff --git a/app/controllers/chat_messages_controller.rb b/app/controllers/chat_messages_controller.rb index 9112bb7..a299379 100644 --- a/app/controllers/chat_messages_controller.rb +++ b/app/controllers/chat_messages_controller.rb @@ -1,7 +1,10 @@ class ChatMessagesController < ApplicationController def index - # TODO: Let's rename this method to #list - @chat_messages = ChatMessage.order(created_at: :desc).limit(100).reverse + @chat_messages = ChatMessage.order(created_at: :desc).limit(2000) + end + + def list + @chat_messages = ChatMessage.order(created_at: :asc).limit(200) render partial: "chat_messages/list" end -- cgit v1.2.3