Johan André

Joined

740 Experience
6 Lessons Completed
0 Questions Solved

Activity

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) }

Posted in How to handle flash messages with TurboJS?

Ahhh! Nice. Thanks!

Posted in How to handle flash messages with TurboJS?

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?

Thanks Gregorio! Will check it out! 

Posted in Using webpacker in Rails Engines?

Yes! Thank you! Basically it says that there is no good way (right now) to use webpacker in 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?

logo Created with Sketch.

Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

© 2021 GoRails, LLC. All rights reserved.