Ask A Question


You’re not receiving notifications from this thread.

ActionCable streaming from a strange channel name

ValentinKLN asked in Rails

I'm following your course "Group Chat with ActionCable" and everything works fine, except one thing: 

When I broadcast to 
ActionCable.server.broadcast "rooms:#{}"
, it does nothing. The "received" function is never called. 

Something is strange in my app console : 
ActionCable] [User 6] RoomsChannel is streaming from rooms:rooms:1
Why do I have 2 times rooms ? I think that's the problem. But in my RoomsChannel file I'm streaming the right name: 
stream_for "rooms:#{}"

Thanks in advance for your answer!

Best regards, 

Oh my god, it's "stream_from" and not "stream_for". SORRY GUYS...
Join the discussion
Create an account Log in

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

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

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

    Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more.

    © 2024 GoRails, LLC. All rights reserved.