Skip to content
loading...

re: My Struggle With Rails ActionCable VIEW POST

FULL DISCUSSION
 

Thank's for you content!!!

And , in the channel.rb , i use follwing code:

class UpdateNoticeChannel < ApplicationCable::Channel
  def subscribed
    tenant = self.connection.env['HTTP_HOST'].split('.').first
    Apartment::Tenant.switch! tenant

    stream_from "update_notice:tenant[#{tenant}]:user[#{params[:user_id]}]"
  end
end

code of conduct - report abuse