Chris Oliver

Joined

293,020 Experience
93 Lessons Completed
295 Questions Solved

Activity

I should have clarified, specifically the deployment logs. It should show tailwindcss compiling the file at some point.

With tailwindcss-rails v3 and tailwindcss-ruby v4, I see this when it runs assets:precompile

≈ tailwindcss v4.0.0-beta.8

Done in 150ms

One culprit here might be that tailwindcss-rails v3 now depends upon tailwindcss-ruby which lets you use multiple different versions of TailwindCSS with the rails integration. It will default to the latest version for tailwindcss-rails v3, but tailwindcss-rails v2 does not use tailwindcss-ruby and will specifically use TailwindCSS v3.

Pretty confusing, but that's likely where the issue stems from.

Interesting. Do the deploy logs show any errors from 3.1?

Did the assets:precompile step get run during deploy? That is what should compile the CSS file for production.

This will be a great performance improvement when Ruby 4 drops, but until then keep using the frozen string literal magic comment at the top of your files!

These types of problems are fun to code golf because they can be implemented so many different ways. ⛳️🏌️‍♂️

I like the idea of morphing for live reloading. It makes for a very smooth experience. There is still lots to improve but I'm excited to have an official live reloading library for Hotwire.

Posted in ActiveMailer .with method

With params it's more consistent with Controllers, but also you don't have to assign instance variables like you're doing. You can use params[:user] right in your template.

def welcome_email
  mail(to: params[:user].email, subject: 'Welcome to My Awesome Site')
end
Hey <%= params[:user].first_name %>,

Make sure you have the builds folder included in the asset pipeline:

# app/assets/config/manifest.js
//= link_tree ../builds

Posted in Javascript not working in production

Hmm. Are you using import maps for these? How are you referencing the files?

Posted in Javascript not working in production

How are you deploying your app?

Posted in Populate dropdowns based on selection

Yeah, that's probably a naturally complex situatino with that many objects.

These days, I'd probably use https://github.com/josefarias/hotwire_combobox and register callbacks so when one of the fields changes, you can hit the server to update the other fields as needed. Might have to be careful that doesn't trigger an infinite loop of updates though.

I know the Rails Foundation is working on updating all of the guides so I'm sure it's on their todo list!

Doesn't the browser usually store the preference for granted notification access?

You might be able to change it so it only calls requestPermission() if Notification.permission === "default"

See: https://developer.mozilla.org/en-US/docs/Web/API/Notification

Thanks Matias!

Yes, it will be prorated. 👍

Thanks for your support!

Are you using import maps yet?

We're using this gem to hide and show the Black Friday sale banners on GoRails. 🎉

Check out our Black Friday sale: https://gorails.com/blog/black-friday-2024

To do that, you'd need to have a way to dynamically add the engine folders to the tailwind.config.js in the parent app. That runs Node, but you could probably have it run a Rails command to get a list of folders that you parse an add to the content: [] dynamically.

The main reason for keeping separate, precompiled CSS for engines is that they don't require the parent app to run Tailwind or any other framework that way.

Adding these exports will use Homebrew's Ruby and you don't want to use Homebrew's Ruby. You want to use Mise as we show in the guide.

After you follow the instructions in the guide, you may need to restart your terminal for it to detect the Rails command.

Posted in Authenticating Blog Admin Pages Discussion

What is the error?

Earn XP by completing lessons, posting on the forum, and answering forum questions