Fix: Omit layout for turbo frames with custom sidebar layout #1024
Reference in New Issue
Block a user
Delete Branch "fix/ommit-layout-for-turbo-frames-with-custom-sidebar-layout"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR folows this hint for turbo frame usage https://github.com/hotwired/turbo-rails?tab=readme-ov-file#a-note-on-custom-layouts and implements custom method for with sidebar layout. This change will ommit rendering layout when turbo frame request is used. It improves performance by returning much smaller html as example for rendering New account modal with layout server retruns 165 KB (request time: 235ms) of html with this change server returns 1.6 KB (request time: 35ms).
Nice idea here, especially with the expensive calculations that are needed for our sidebar layout.