Subscribe to GoRails to get access to this episode and all other pro episodes, and new awesome content every month.
Unlimited access. Cancel anytime.
Learn how to implement realtime notifications with ActionCable
# app/channels/application_cable/connection.rb module ApplicationCable class Connection < ActionCable::Connection::Base identified_by :current_user def connect self.current_user = find_verfied_user end protected def find_verfied_user # We can just access Warden directly to find out if the user is logged in or not # Using Warden directly will give us access to that as it's what Devise uses internally for authentication if current_user = env['warden'].user current_user else reject_unauthorized_connection end end end end
hey chris, I ve got this in my logs
/usr/local/opt/rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/redis-3.3.1/lib/redis/client.rb:345:in `rescue in establish_connection': Error connecting to Redis on localhost:6379 (Errno::ECONNREFUSED) (Redis::CannotConnectError)
I have the same problem below. I ve got this log
/Users/a960401/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/redis-3.3.3/lib/redis/client.rb:345:in `rescue in establish_connection': Error connecting to Redis on localhost:6379 (Errno::ECONNREFUSED) (Redis::CannotConnectError)
and I did brew install redis, but It doesn't work same. What I have to do??
I liked this lesson but I had to change the model from Notifications to Messages b/c rails was telling me that Notifications is a reserved term. Anyone else have that issue? Maybe I messed something up but if I didn't it would be nice to have this rerecorded with a model like Messages so that it is easier to follow and the viewer can cut and paste things from the notes below without having to switch out terms. I also was not able to get the messages from the job to appear on the user pages. Not sure why. I got no errors but still Application.render never rendered anything on the page.