Marie Lamoureux
05/11/2023, 7:09 AMadd_remove_from_rejected.html.erb.deface
and add my code to it.
But if I take inspiration from solidus_subscription_gem
, for example, I can see something like that
Deface::Override.new(
virtual_path: "spree/admin/products/_form",
name: "solidus_subscriptions_product_subscribable_checkbox",
insert_after: "[data-hook='admin_product_form_promotionable']",
partial: "spree/admin/products/subscribable_checkbox"
)
I'm guessing it does the same thing but I'd like to understand.
2. How do I deploy my changes to production?
Both ways seems to work locally but I super confused about how to deploy changes I make in the backend to production. This is probably a stupid question but I cannot wrap my head around it 😅 If I create my overrides views in my main app, it's not working because it cannot find the override partial Missing partial app/overrides/views/products/_clothing_checkbox
. But any code I add in the backend is of course not tracked by me git repo.
Thank you for your help!Ryan Woods
05/11/2023, 7:37 AMMarie Lamoureux
05/11/2023, 8:02 AMgit add commit push
my code, and deploy it. And this works.
But, if I code bundle open solidus
the backend files and bring changes to them, and do a git add . git commit -m
I'm getting a nothing to commit
message. No change is being tracked there. I hope it makes sense.Ryan Woods
05/11/2023, 8:12 AMcode bundle open solidus
) locally, is good to test stuff, but it won’t affect the production code. Essentially, you’re pushing a commit, which sends all your code, including the Gemfile and Gemfile.lock, which tells production what versions to use for the gems - whatever Solidus version was locked to (code bundle info solidus
), will be what production uses.
If you want to override code inside Solidus, you have a few options
• For models or class files, this guide should help
• But for views:
◦ for frontend, as you used the frontend_starter, you can change the views you have locally in your codebase; and
◦ for the backend, you can deface it like you mentioned (looks like you have already looked at this guide) (you can also override the whole file but may require more maintenance in the future). The new code you’ll add needs to be in your code, so you can commit it.Ryan Woods
05/11/2023, 8:13 AMcode bundle pristine solidus
Ryan Woods
05/11/2023, 8:15 AMMarie Lamoureux
05/11/2023, 8:22 AMkennyadsl
app/views/spree/admin/something
.Marie Lamoureux
05/12/2023, 8:13 AMkennyadsl