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
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Thank's for you content!!!
And , in the
channel.rb
, i use follwing code: