diff options
author | David Gay <david@davidgay.org> | 2021-05-19 22:53:38 -0400 |
---|---|---|
committer | David Gay <david@davidgay.org> | 2021-05-19 22:53:38 -0400 |
commit | 9415011b5fd192f1bafeaa9b6eacbb7921382a00 (patch) | |
tree | f25d9d633237cae5d7b73166e6612a9b53312714 /app/views/application | |
parent | da678b22b5db05554b44234b341fabc9d83ff700 (diff) |
Chat
Diffstat (limited to 'app/views/application')
-rw-r--r-- | app/views/application/_chat.html.erb | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/app/views/application/_chat.html.erb b/app/views/application/_chat.html.erb index 868986b..8abe73c 100644 --- a/app/views/application/_chat.html.erb +++ b/app/views/application/_chat.html.erb @@ -1,8 +1,13 @@ -<div class="flex flex-col h-full text-sm"> - <div id="chat_output" class="overflow-auto flex-grow"> - Chat output will go here. +<div data-controller="chat" class="flex flex-col h-full text-sm"> + <div data-chat-target="output" id="chat_output" class="overflow-auto flex-grow"> </div> <div class="flex-none"> - Chat input will go here. + <%= form_with model: ChatMessage.new, html: { autocomplete: "off" }, local: false, + data: { action: "chat#send" }, class: "flex" do |f| %> + <%= f.collection_select :chat_room_id, ChatRoom.accessible_to(current_char.user), + :id, :short_name, class: "flex-none" %> + <%= f.text_field :body, size: "1", maxlength: 255, required: true, + data: { chat_target: "message" }, class: "flex-grow inline-flex" %> + <% end %> </div> </div> |