Skip to content

Update streaming chat tutorial for Rails 8 #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

andyw8
Copy link

@andyw8 andyw8 commented Apr 25, 2025

Only a few minor changes were needed.

@andyw8 andyw8 changed the title Update streaming tutorial for Rails 8 Update streaming chat tutorial for Rails 8 Apr 25, 2025
@@ -119,7 +119,7 @@ and the Message model:
class Message < ApplicationRecord
include ActionView::RecordIdentifier

enum role: { system: 0, assistant: 10, user: 20 }
enum :role, { system: 0, assistant: 10, user: 20 }
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -168,6 +168,8 @@ Add the Chat controller:
```ruby
# app/controllers/chats_controller.rb
class ChatsController < ApplicationController
respond_to :html
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise it fails with In order to use respond_with, first you need to declare the formats your controller responds to in the class level..

@andyw8 andyw8 marked this pull request as ready for review April 25, 2025 16:42
@andyw8
Copy link
Author

andyw8 commented Apr 25, 2025

btw, it works with ActiveJob/SolidQueue with some minor changes, no need for Redis or Sidekiq - I can make a separate PR for that, if you'd like.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant