Rails: Eliminate Circular Dependencies With Multiple Layouts

0
127

If you have multiple layouts in a Rails Application the manifests cannot include require_tree. You’ll encounter an infinite loop if require_tree is not removed.

This is the wrong way.

https://gist.github.com/thehashrocket/7063c6d1b7399517893f7829cb2aa9d5.js

This is the correct way.

https://gist.github.com/thehashrocket/cc5cb350d4c7881ec2910df75b8467c2.js