Class: MessagesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- MessagesController
- Defined in:
- lib/generators/appchat/templates/messages_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'lib/generators/appchat/templates/messages_controller.rb', line 8 def create = @chat..build() if .save GetAiResponseJob.perform_later(.chat_id, .content) redirect_to (chat_id: @chat.id), notice: 'Message was successfully created.' else render :new end end |
#index ⇒ Object
18 19 20 |
# File 'lib/generators/appchat/templates/messages_controller.rb', line 18 def index = @chat. end |
#new ⇒ Object
4 5 6 |
# File 'lib/generators/appchat/templates/messages_controller.rb', line 4 def new = @chat..new end |