Skip to content

Instantly share code, notes, and snippets.

View stephlaf's full-sized avatar

Stéphane Lafontaine stephlaf

View GitHub Profile

Styling your chat

So that the messages appear on the right if you are the sender, and on the left if you are the receiver, both with their own background-color.

Screen Shot

For that, we will need to add a few things in a number of files, namely to pass infos to our Stimulus chatroom_subscription_controller

Let's start by passing the current_user id as a value to Stimulus from our show page.