Let Config.layout accept all the arguments allowed by Rails
Is your feature request related to a problem? Please describe.
I need to use a simplified layout for the checkout and for other places of the store. It's very common to have less UI during the checkout to avoid distractions.
Currently the Common controller helper is the one setting the layout and the config entry gives no extension point to dynamically select the layout based on the current controller/action/request etc.
As we all know "decorating" a helper is a pain in the neck, and requires the module to be re-included in all the classes its included in. It wouldn't be much of a problem if we didn't have 6 controllers including that module, if we take auth-devise into account.
Describe the solution you'd like
I'd like to see Spree::Config.layout accept a proc that takes the current controller instance as an argument and/or is evaluated with instance_eval inside it as it's done by Rails. Even better would be to just accept anything allowed by ActionView::Layouts::ClassMethods#layout.
I would also suggest to switch the default layout name from spree_application to application as most of the store I've seen only used the solidus layout and spree_application is very confusing for newcomers to solidus.
Describe alternatives you've considered
- conditionals inside the layout: they would work but that's yet another a workaround fighting solidus instead of making things right
- decorating the
Commoncontroller helper: it's a nightmare - decorating all the individual controller involved in the checkout: equally overkill and not very maintainable
See also https://github.com/solidusio/solidus/discussions/3868
Closing this, it has been moved to Discussions under Feature requests. Thanks!