This is part 2 and covers private chats/direct messages/whispers between users. You can see the full playlist here: kzbin.info/aero/PL3mtAHT_eRex1sJI2uoTBgFT3qAXFbEcy Next time we look forward to Stimulus and User Avatars. Hope this helps!
@SandroTerra12 жыл бұрын
Your tutorials are amazing! I had never programmed before. But now, I'm moving forward and achieving the goal. My most sincere thanks! Hugs from Brazil!
@littlenikola2 жыл бұрын
Amazing tutorial so far, everything is clear to understand and the project is really fun
@nikitasemenov31282 жыл бұрын
Thanks for sharing and keep going!
@ppavelcars2 жыл бұрын
Amazing tutorial! Thank you, Deanin!
@Deanin2 жыл бұрын
Thank you! Glad it was helpful!
@leizhang68392 жыл бұрын
Hey body, thanks for sharing!
@l.henriquef40332 жыл бұрын
you are the best!
@Deanin2 жыл бұрын
Thanks! Hope this helps :)
@angelconcha7376 Жыл бұрын
I wanted to thank you for your awesome work! It helped me alot. I also wanted to ask you, how come i cant see my messages once I send them unless I refresh the page :(( It was working just fine until now. Thanks again
@DefCantGame2 жыл бұрын
Am I the only one that would love to see Dean do a Rails 7 version of a wordpress competitor or something like permissions, roles, content. Love the content
@Deanin2 жыл бұрын
No I'm sure you're not the only one, so I'll add it to the list! 😀
@DefCantGame2 жыл бұрын
@@Deanin Would be greatly appreciated as someone who does mostly Django and Laravel but been following your videos feels like thats another good real world use case. Love the detail/explanations, keep it up!
@PAOLASAVAL-d1l Жыл бұрын
Can you make a tutorial for a chat between client and workers? i believe is call a chat widget
@kafuprfin Жыл бұрын
its need a little JS and chat is done!
@stoianstoianov94812 жыл бұрын
Nice tutorial! How can we authorize access to private messages just for two users and restrict third one to view the room ?
@ShimolKhan-y7d Жыл бұрын
How can we reset the room input form field and message input form field after submission? Tried several times, but failing.
@rohitkamalapur14522 жыл бұрын
I have followed the same but when I do direct message to a particular user the same message shows in all the other rooms. can you help me where did I go wrong . thanks in advance....
@DevBishwasBh2 жыл бұрын
How to detect if current user is actual current_user for edit/delete feature with broadcast?
@Deanin2 жыл бұрын
If you're broadcasting from the controller, it only should be fine without a check. If the broadcast happens in the model, I think the officially recommended choices are either: Do a client side check with JavaScript to hide the buttons if you aren't the current user or an admin or Create a channel on your index page that has a turbo_stream_from "#{current_user.id}" and then in your model you'll be able to broadcast to that channel and only that user will get it. So that channel would be specifically the edit and delete buttons that are then added to the messages with a partial. You'd then have to make sure that the other channel gets messages without the edit and delete button, so that everyone gets the messages once. It sucks because as I'm sure you've noticed, turbo broadcasts don't let you check who the current user is. Drives me nuts lol
@DevBishwasBh2 жыл бұрын
@@Deanin I just create a input field (with current_user.id let's say: input_current_user)specifically inside the comment section and whenever someone comments, and the stuff gets broadcast, and stimulus js check the comment.user value with the input_current_user, and returns the stuff. I just wanna confirm if hiding delete button with js is a secure way to do it?
@Deanin2 жыл бұрын
Yeah it's secure as long as you do a check in your controller to make sure the user has permissions. So inside or before the delete action, check to make sure the message.user == current_user That way if they do manage to send the right info to the backend or unhide anything you've hidden, your backend still won't do anything.