Ask A Question

Notifications

You’re not receiving notifications from this thread.

Can you use Actioncable for multiple things in your project?

Masud Hossain asked in Rails

I want to use actioncable to pull notifications AND also use it for user to user chatting. Is this possible and pain free to do?

I guess what i'm asking is, can i join these two videos together into one project without doing anything special:

https://gorails.com/episodes/realtime-notifications-with-actioncable?autoplay=1
https://gorails.com/episodes/direct-messages-in-realtime-with-actioncable?autoplay=1

Reply

Hey Masud,

Absolutely. The way it's designed is that you can create a new channel for each feature you want and the ActionCable code internally will automatically separate out the messages for each of those channels. That means you can have one for notifications and one for chat and they will be separated out between those channels.

Reply
Join the discussion
Create an account Log in

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

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

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