如何覆盖 Solidus 中的视图?
How can I override views in Solidus?
如何在 Solidus 中覆盖视图?
目前我正在将视图从 Solidus Gem 复制到我的应用程序中 - 我发现这很容易出错。
Solidus 2.2.0 引入了前端视图覆盖生成器,可将视图复制到您自己的主机应用程序中。
In order to customize a view you should copy the file into your host
app. Using Deface is not recommended as it provides lots of headaches
while debugging and degrades your shops performance.
Solidus provides a generator to help with copying the right view into
your host app.
Simply call the generator to copy all views into your host app.
$ bundle exec rails g solidus:views:override
If you only want to copy certain views into your host app, you can
provide the --only argument:
$ bundle exec rails g solidus:views:override --only products/show
The argument to --only can also be a substring of the name of the view
from the app/views/spree folder:
$ bundle exec rails g solidus:views:override --only product
如何在 Solidus 中覆盖视图?
目前我正在将视图从 Solidus Gem 复制到我的应用程序中 - 我发现这很容易出错。
Solidus 2.2.0 引入了前端视图覆盖生成器,可将视图复制到您自己的主机应用程序中。
In order to customize a view you should copy the file into your host app. Using Deface is not recommended as it provides lots of headaches while debugging and degrades your shops performance.
Solidus provides a generator to help with copying the right view into your host app.
Simply call the generator to copy all views into your host app.
$ bundle exec rails g solidus:views:override
If you only want to copy certain views into your host app, you can provide the --only argument:
$ bundle exec rails g solidus:views:override --only products/show
The argument to --only can also be a substring of the name of the view from the app/views/spree folder:
$ bundle exec rails g solidus:views:override --only product