Real-Time Activity with ActionCable and Rails 6 | Ruby on Rails Projects

Поделиться
HTML-код
  • Опубликовано: 5 ноя 2024

Комментарии • 12

  • @gleb-dev
    @gleb-dev 2 года назад

    Hi! Thank you for your incredibly valuable work! It's really awesome, especially for folk like me who are newbies in Rails!
    When I did all the steps according to this video, I noticed that if a user switches rooms his status turns to offline. I did a workaround (probably not the best one) in two lines:
    CONNECTION_PING_INTERVAL = 5.seconds
    periodically :appear, every: CONNECTION_PING_INTERVAL
    Maybe this comment will be of some help to someone 😂

  • @mycode0
    @mycode0 2 года назад

    Are you planning on returning to ruby on rails now that rails 7 is here. Your channels is one of the good ones

  • @BluRRedV1sI0N
    @BluRRedV1sI0N 4 года назад +1

    Just a small hint: Since ES6 you can do this instead of building a for loop for the elements: Array.from(elements, element => element.classList.add("online")). You could also use the spread operator [...elements], but Array.from support a callback function!

  • @arturdebicki7026
    @arturdebicki7026 4 года назад +1

    Great tutorial! thank you!

  • @stanmx
    @stanmx 4 года назад +1

    What is the difference using between ` ` and ' ' in this line `user-${data.user_id}-status` --the add/remove online not work with ' '. I don't really like how works right now the online offline, right now in my example only appears if you add new message, but not in the old ones, i will watch the next episodes to see if something i forget to do. Saludos.

  • @GonzaloGaleano
    @GonzaloGaleano 4 года назад

    👏🏼👏🏼👏🏼 thank you!

    • @TechmakerTV
      @TechmakerTV  4 года назад

      Sure thing! Glad you are enjoying the videos!

  • @arturdebicki7026
    @arturdebicki7026 4 года назад +1

    When you enter channel at 25:15 it shows that 'Flying-intern' is offline. And it keeps that status until actual 'Flying-intern' do not refresh the page. Plus if that new user refresh page after getting new updated status of being online, he loss it again :( Any idea what to do?

    • @TechmakerTV
      @TechmakerTV  4 года назад

      Hi Artur! I'm going to take a look at this and make another update video. I noticed mine wasn't working perfectly either. There may need to be a stronger backend implementation to keep track of who is active. I'm going to think on it a bit :)

  • @arturdebicki7026
    @arturdebicki7026 4 года назад +1

    And I added this code to our room_channel.js to scroll our chat down after sending a message.
    let messages = $(".chat-room");
    messages.scrollTop(messages[0].scrollHeight);
    But I had to install jquery to make it go. Could you help me with refactoring it to pure JS? Thanks!

    • @TechmakerTV
      @TechmakerTV  4 года назад

      Nice! I'll see about adding a pure JS version.