Chris Oliver


276,770 Experience
31 Lessons Completed
299 Questions Solved


Posted in Renew price for my subscription

Renews at the same price. 👍

You should be able to just modify the esbuild command in package.json to run twice.

esbuild app/javascript/application.js --bundle --sourcemap --outdir=app/assets/builds --public-path=assets && esbuild app/javascript/admin.js --bundle --sourcemap --outdir=app/assets/builds --public-path=assets

Posted in Hobby server alternatives since Heroku going paid

In no particular order:

  • (I built this! 🤓)
  • DigitalOcean Apps
  • Railway is a bit different because it runs on your server(s) and you only pay for servers. If you deploy 2+ apps on a single server, you save money because most hosts charge per-app fees.

Posted in Video Hosting

We use Wistia. It's expensive and probably cheaper done with S3 or similar.

Posted in I am new to rails.

Check out the Ruby on Rails for Beginners course and then the Series pages to learn specific Rails topics.

Posted in First open source contribution to turbo-rails

Yeah, they actually have to copy the Javascript into the turbo-rails gem periodically to keep it in sync. It's kind of annoying and I'm not sure if it's done automatically with each new release of Turbo.

Posted in First open source contribution to turbo-rails

You'll want to use to make the Javascript change. The Rails package just includes a copy of the latest Turbo for convenience so you'd want to fix it in the upstream Turbo JS package.

If you clone the Turbo repo, you can specify the Turbo package in your package.json if you set up an app using jsbundling-rails. That should be easier than trying to modify the gem's turbo.js file.

I'd highly recommend checking out our Rails for Beginners course which you can find here:

Posted in Datatables From Scratch Using Hotwire Discussion

Tables are very strict in their layout and so you can't do certain things like make a clickable row. That's why divs are more useful often times.

Posted in URL Based multi tenancy

Also added it to my to-do list of screencasts

Posted in URL Based multi tenancy

It's easier than you might think! You just point the domain to the server and Rails doesn't care what domain it is.

Then you can use like ActsAsTenant to match the domain with an Account. Or Account.find_by(domain: request.domain) if you want to do it from scratch

Posted in Honest opinion needed

Hey Andrew,

Most of these things change very rarely, so they're not actually outdated.

If you're deciding between Rails and Laravel, try them both! Ruby and PHP are very different languages so you might enjoy one over the other. Both web frameworks offer pretty similar options at the end of the day.

Thanks for sharing this Blake! I just chain mine together so I don't have the additional dependency. I'll have to do a screencast on multiple output files. 👍

Exactly, there might be some additional things we need that are unique to one service, so having the full auth hash is useful.

Posted in Ruby question - Generating a nested hash with group_by

Sounds good! It sometimes just takes a little bit of mapping out what you've got vs where you need to be and then the pieces start falling together.

Posted in Ruby question - Generating a nested hash with group_by

A nested hash could work. You could also do an array since you could use the index to determine the month too. For example, 1 -> January, 2 -> February, etc.

How do you currently know which months to remove? Is it a word as a string ("January") or the number of the month like 1,2,3?

You can use I18n.t("date.month_names") in Rails to translate to and from the names and integers.

irb(main):001:0> I18n.t("date.month_names")
=> [nil, "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]

Posted in Ruby question - Generating a nested hash with group_by

Hey David,

What's the final result has that you're trying to accomplish? It would allow for more concrete steps on solving the problem.

Are you trying to make something like:

{ 2017 => [4583.33333333, 4583.33333333, 4583.33333333..., other months], 2018 => ... }

And then delete certain months in the array? or something else?

Posted in Datatables From Scratch Using Hotwire Discussion

I just used it for the first time yesterday on a button_to.

<%= button_to 'Delete', @resource, method: :delete, form: { data: { turbo_confirm: 'Are you sure?' } } %>
logo Created with Sketch.

Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more. Icons by Icons8

© 2022 GoRails, LLC. All rights reserved.