Chris Oliver

Joined

292,510 Experience
92 Lessons Completed
296 Questions Solved

Activity

That's awesome. Curious to hear what change(s) made the biggest difference. That's a huge improvement.

Posted in Structured Output with Gemini 2.0 Discussion

Structured output makes advanced AI integrations actually possible. Imagine trying to parse a string response every time without structured json output! 😅

It's always trade-offs. For example, an icons gem is probably going to load them into memory so rendering icons is faster by not loading them from disk every time.

Reducing memory usage sometimes means making things slower so don't look at it as an arbitrary goal. You may want to keep it low so your server costs are low, but in production paying for more RAM to achieve more throughput is often worth the trade-off.

In general, I think a Rails app tends to use 400-600MB of RAM. Gems and different configurations can affect the usage so there's not really a specific number to aim for.

One thing you can do is enable jemalloc and that often reduces memory usage by a good percentage as it's more efficient than the default malloc.

https://community.render.com/t/how-to-use-jemalloc-in-ruby-web-service/1183

Posted in How do I dynamically update views when objects change

broadcasts_refreshes actually broadcasts to a couple different streams:

<%= turbo_stream_from :lockouts %>
<%= turbo_stream_from @lockout %>

Posted in How do I dynamically update views when objects change

Yeah, behind the scenes you'd use ActionCable, but Turbo morphing is what will make that easy. You'll add "broadcasts_refreshes" to the models to have them broadcast a page refresh with those updates automatically anytime the database records change. We don't have a lesson on that just yet but I'll make one for you!

Posted in AI Summaries in Rails with Gemini 2.0 Discussion

We'll definitely do a video on structured outputs. 👍

Posted in AI Summaries in Rails with Gemini 2.0 Discussion

What other types of AI integrations would you like to see?

Posted in How to send Webhook?

Awesome! Sounds like a fun project. Definitely want to hear more about how it goes.

I remember now that I wanted to cover how to build this but also extract it into a gem so maybe we can kill two birds with one stone on this series. 🤔

Posted in How to send Webhook?

I don't think we ever made a lesson for this. I will prioritize that. 👍

Posted in Lazy Requiring Dependencies in Ruby Discussion

I love removing dependencies. 💖

Also, learning how libraries can make features or dependencies optional is a great thing to learn along the way.

Posted in How can I squish SQL for log tidiness (automatically)?

A couple things come to mind:

  1. Unless you have other things parsing the SQL, squishing it should be fine.
  2. You probably add to the payload instead of modifying it.
event.payload[:squished_sql] = event.payload[:sql].squish

Posted in 2025 Rails frontend solution: Phlex or ViewComponents?

I think Phlex or View Component is mostly personal preference. Phlex will be all Ruby and View Component can be a mix of Ruby classes, ERB, and sidecar Stimulus controllers contained in the same folder. Either way you go they're pretty similar.

Posted in Hash Fetch with Default Value Discussion

Guarantee you I've made this mistake many times over the years. 😅

Posted in Local SSL Certificates with Caddy Discussion

Oh yeah?

Posted in Local SSL Certificates with Caddy Discussion

Yep! The cool thing about Caddy is you can use it with anything, not just Rack apps.

Posted in Local SSL Certificates with Caddy Discussion

I'm curious... if you've needed SSL for local development before, what were you building?

Posted in How do I disable testing in Jumpstart pro?

Feel free to change any of the fixtures as needed. The tests are there to make sure the built-in functionality works as expected, but you'll need to adjust them as you build out your application.

Posted in How to use params.expect in Rails 8+ Discussion

Agreed! The only thing that feels a little weird is the nested arrays, but it works so much better!

Hmm, yeah then you've already done that. Strange, I'm not entirely sure.