Chris Oliver

Joined

292,760 Experience
93 Lessons Completed
296 Questions Solved

Activity

Posted in Rails Initialization Internals Discussion

You're welcome and thanks for watching! Hope it helps you solve problems in the future. 👍

Posted in Rails Initialization Internals Discussion

Excellent! That stuff has always been poorly documented, so I'm glad we could help!

Posted in Rails Initialization Internals Discussion

Glad you enjoyed it Michael! We will have to do more episodes like this. 💪

Posted in Rails Initialization Internals Discussion

I get irrationally excited when I learn how Rails or other gems work internally. Love the feeling when something feels like a mystery and then you realize it's actually really straightforward when you see how it works. ❤️

Posted in Rails Initialization Internals Discussion

I have done this in a few previous episodes (can't remember which ones) so you'll have to see if you can find those. We will definitely cover more stuff like this in the future!

Posted in Pass variable to Flash object

You can use html_safe on the notice message to allow them to include HTML.

redirect_to some_path, notice: "<div data-controller=\"autohide\">Some message</div>"

Glad you liked it Ahmed!

Glad you're enjoying it. We'll keep doing more Hotwire stuff!

They sure do and we will absolutely cover more ideas for them. Next episode is going to walk through using them to implement browser notifications. 👍

Yep! I think a Stimulus controller for remove probably makes the most sense, however this was a great example to show off a small custom Turbo Stream.

I just updated the Windows 10 and 11 guides.

You have to manually enable systemd right now, but you can start Postgres using:

sudo service postgresql start

Posted in Net Http API Client from Scratch Discussion

The old episodes are still there. This is just a new series digging deeper into designing API clients. 👍

Try setting it to use host: 127.0.0.1 in database.yml.

By default, it's going to look for the Unix domain socket, which means a file on the linux system and not the port from your Windows PostgreSQL server.

The number_to_currency helper is useful for this and I highly recommend the money gem.

Posted in Realtime Notifications with ActionCable Discussion

To start redis now and restart at login:

brew services start redis

Posted in Net Http API Client from Scratch Discussion

Errors are definitely a bit of a pain. I liked this approach from StackOverflow: https://stackoverflow.com/questions/5370697/what-s-the-best-way-to-handle-exceptions-from-nethttp

ALL_NET_HTTP_ERRORS = [
  Timeout::Error, Errno::EINVAL, Errno::ECONNRESET, EOFError,
  Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError, Net::ProtocolError
]

begin
  your_http_logic()
rescue *ALL_NET_HTTP_ERRORS
  …
end

Posted in Extracting Reusable Base Classes In Ruby Discussion

A constant is faster to lookup since it's saved, but a method that returns the string would work fine too.

Also we just published the generators episode!

Posted in Extracting Reusable Base Classes In Ruby Discussion

He's always causing a ruckus or being lazy. Nothing in-between! 🐈

Posted in Testing HTTP Requests with Webmock Discussion

You'll want to do that for your actual integrations, for sure.

These are just some tests to make sure we've implemented the generic HTTP calls correctly. That way our real API clients don't have to worry about testing the underlying HTTP methods, they can focus on everything else.

Posted in Custom Rails Generators for API Clients Discussion

Glad to hear it! I've been trying to make a point to cover that in videos more often because I think that's the biggest superpower you can learn as a developer. 💪