Ask A Question

Notifications

You’re not receiving notifications from this thread.

Realtime Group Chat with Rails [Revised] - Part 2 Discussion

Nice video Chris.

I did something similar on a project a while ago but not with the elegant stimulus js solution.

Something that I am wondering about Websockets. In terms of edges cases or pitfalls that one could fall into pretty easily, what are some good ones to look out for?

Reply

Thanks Chris! I'm hoping for another episode in the series for direct messages.

Reply

Direct messages and group messages would be a dream

Reply

Great stuff Chris, Stimulus is really growing on me. Omakase for the win!

Reply

Hi Chris,
How can we identify our messages and their messages for user interface stuff?

Reply

Hi Chris,

I'm not sure if anyone has found this same issue, but I can't get the action to clear the input to fire in the stimulus controller. I'm using Rails 6.1.3, although I don't know if that makes a different. It's almost as if the ajax:success event is never fired or never detected. I can get an action to work on the submit event for the form, but none of the ajax events appear to work.

Reply

I just found out. It seems I needed to add local: false to the form. Now it works. Unrelated, I keep getting warnings about data-target-channel being deprecated in favor of data-channel-target.

Reply

Hi Chris,
How can I make this happen with rails 5.2?

Reply

Note: Following along with Rails 7.1.3.2 and deleting message_channel.js as mentioned at 12:11 causes both connections to stop working. I deleted all the contents of the message_channel.js file, but kept the file itself and it appears to only be connecting to the channel with the channel ID once as expected

Reply

At 18:03 ajax:success-> is not working for rails 7.1.3.2 and can be replaced with turbo:submit-end->

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 86,796+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.