Last active
January 1, 2024 03:28
-
-
Save vincentopensourcetaiwan/b5bd1aa5b2dc04611916e8ded9426430 to your computer and use it in GitHub Desktop.
app/views/chats/index.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div data-controller="chat" class="chat-container"> | |
<h1>ChatGPT</h1> | |
<section data-chat-target="conversation" class="chat-conversation"> | |
</section> | |
# send a message to the server | |
<%= form_with data: { action: "chat#generateResponse" } do |form| %> | |
<div class="chat-input"> | |
<%= form.text_area :message, | |
id: 'prompt', | |
data: { chat_target: "prompt" } | |
%> | |
<%= form.submit 'Send' %> | |
</div> | |
<% end %> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment