Skip to content
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

Messages appear only in proper chatrooms #9

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

Conversation

Goldtean
Copy link

This fixes the issue of having a message appear in all chatrooms. Created a different name for each stream based on the chatroom's id which is inside of a hidden field in the message partial. If you like this solution, please follow me or star some of my projects! Thanks!

return $('#messages').append(this.renderMessage(data));
},
chatroom_id: function(data) {
Copy link

Choose a reason for hiding this comment

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

Don't think we need this chatroom_id function?

Copy link
Author

Choose a reason for hiding this comment

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

I wrote this code a long time ago but I believe it's needed to identify the chatroom.

Copy link

@TImPDaley TImPDaley left a comment

Choose a reason for hiding this comment

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

Nice Job... I was struggling on the best way to fix this... and yours is clean. Thank you.

NaokiIshimura added a commit to NaokiIshimura/action-cable-example that referenced this pull request Apr 24, 2018
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.

3 participants