Activity
You're welcome and thanks for watching! Hope it helps you solve problems in the future. 👍
Excellent! That stuff has always been poorly documented, so I'm glad we could help!
Glad you enjoyed it Michael! We will have to do more episodes like this. 💪
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. ❤️
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
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.
To start redis now and restart at login:
brew services start redis
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
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!
He's always causing a ruckus or being lazy. Nothing in-between! 🐈
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.
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. 💪