Ask A Question

Notifications

You’re not receiving notifications from this thread.

Realtime Notifications with ActionCable Discussion

Thanks, Chris! This is an awesome episode, you're the man!

Reply

You're welcome! 🤓

Reply

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)

Reply

You need to have Redis installed and running. If you're on a Mac, "brew install redis" assuming you have Homebrew.

Reply

I watched this last night and got tripped up because my localhost isn't the default. After some fumbling I added this to my development.rb file. config.action_cable.allowed_request_origins = ['http://localhost:1701']

Reply

I downloaded the repository, then I was testing what happened if the user changes the page, the server stills send pings to the client. Is that fine? Is the something to be worried about?

Reply

Chris, any chance you could follow this episode up at some point and build the full drop down functionality like you did in the previous notification episodes???

thx,

Reply

Should the warden check against current_user be == ?

if current_user = env['warden'].user

Reply

I have the same question. It doesn't validate if I use "==", which I don't understand

Reply

nevermind. I see how it works. If env['warden'].user is nil, then the whole statement is nil which points you to the else. if env['warden'].user is not nil, then the if statement is true and current_user gets assigned to warden user.

Reply

Wow, that one got me too

Reply

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??

Reply

For anyone having this after installing Redis, you still need to start Redis server by typing into the terminal:

redis-server

Reply

To start redis now and restart at login:

brew services start redis
Reply

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.

Reply

I just went through it and I was able to create Notification model just fine

Reply

There is crazy amount of information in this episode, great job.

Reply

+1 point for link to AJAX version episode ! ;)

Reply

Can you please share the link if you found it?

Reply

Chris, would you consider making another episode on this action cable notifications subject? Something like the improvement episode that you made for the non action cable notifications? I would really like to see what logic could be set up to load them into a dropdown from the navbar (just like the previous notifications), and to manage them as unread. Bonus points for implementing a chime or noise for new unread notifications...

This is what I am looking to do in my own personal project.

Reply

I have a crazy request, I need to replace ActionCable by some STOMP implementation, so the FrontEnd creates a WebSocket using STOMP protocol, I did research but didn´t find any possible solution, any idea or approach that can help? thanks

Reply

Hey Chris! great episode! Are you planning to update this with turbo streams and Broadcastable syntactic sugar?

Reply

You bet! I am planning to do one on notifications to specific users as an example.

Reply

when will you post it? I would love to see it!!

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 82,969+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.