Ruby on Rails #153 Refactoring Hotwire Modals
21/11/2023 (6 months ago)
I AM SORRY for not providing the complete, best approach right away.
In E151 we connected turbo frame modals
with the html dialog element.
However this approach was not optimal:
- We were needlessly adding a stimulus controller on the BODY html tag;
- dialog html was present in the layout file, even if we do not need it right now;
Let's clean up the mess and make our modals even better! ✨
Special thanks to @ledockol for pushing me on this one! 💪
Episode source code: https://github.com/corsego/151-dialog-turbo-modals/commit/6f4869005c28aca372319cc4f0f9e7e1ddd8a0e1
Based on this blogpost: https://blog.corsego.com/turbo-modal-dialog#refactoring
0:00 old implementation
0:38 I AM SORRY
1:12 move modal dialog from body to new.html.erb
5:40 reusable dialog wrapper
7:59 restrict opening modals in new tabs
0
Sign in to join the conversation
Recommended based on what you are watching now
01:04:22
Free Ruby on Rails #61 Live session: Gem Devise: ALL THE PLUGINS
17/01/2022 (over 2 years ago)
17:16
Free Ruby on Rails #26 send emails with Action Mailer - Complete Guide
18/05/2021 (almost 3 years ago)
32:17
Free Ruby on Rails #56 Generate QR codes, Barcodes, use ServiceObjects
06/10/2021 (over 2 years ago)
image generation
17:55
Free Friendly Show S2E5 Balkan Ruby! 👽 Irina Nazarova. Making $ on Dev tools 🤑🤑🤑
26/04/2024 (20 days ago)
open source