Is it possible to use my own application layout file in my main rails app instead of spree's? I have my main app already setup with devise and then added spree. Spree frontend uses
frontend/app/views/spree/layouts/spree_application.html.erb
in its own gem as its layout and I read how to override that file with my own in app/overrides
or Deface, but I don't want to duplicate the content that is already in my app/views/layouts/application.html.erb
.
I'm looking to use my own file instead or overriding spree's.
You have 2 options:
app/view/spree/layouts/spree_application.html.erb
in your rails app and rails will pick your fileSpree::Config[:layout]
in an initializer (ex: Spree::Config[:layout]='application'
)Spree::Config[:layout]='application'
worked for me. But when I tried to switch to the spree default layout by removing this line, it did not work. After spending almost an hour I was able to switch back to default Spree::Config[:layout]='spree/layouts/spree_application'
Adding this answer just in case someone else gets stuck with similiar error.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With