Activity
Good stuff! I have an idea for another episode/lesson:
When using TailwindCSS (which is pretty much the standard nowadays) in an Rails app, I found myself wanting to build "plugins" or extended functionality nby using engines. I would be very cool to have a way to automatically scan the views in the engine when creating the TailwindCSS output (using the TailwindConfig from the main app). I've seen some examples that precompiles a css-bundle in the engine and then include it in the main app.
Maybe this is a solved problem? :)
You should really create a gem for this. Or maybe I should? :)
Really awesome timing with this episode! Helped me figure out some issues with conditional eager loading! :) Good job!
Posted in Ruby Module Include Tracking Discussion
Nice screencast! I use this to check which models includes a concern:
ActiveRecord::Base.descendants.select { |c| c.included_modules.include?(Contentable) }
Ahhh! Nice. Thanks!
When using turbo-frame to switch from showing a partial of model to showing the form of model, how do I handle flash messages?
The failed state - for failed validation - is pretty straight forward, since I re-render the form and outlining the validation errors in the form. But when a form is successfully submitted I would like to show a message (preferably like a toast) saying the data is saved.
Any ideas how to do that in a clean way?
Posted in Using webpacker in Rails Engines?
Posted in Using webpacker in Rails Engines?
Posted in Using webpacker in Rails Engines?
I'm making a pluggable CMS engine and want to keep the JS/CSS (preferably by writing Tailwind components) in the engine. It works great with models, controllers, routes and the asset pipeline, but I really can't figure out the best way to do it with Webpacker-packs.
Any tips?