我是个新手。我想在spree的视图中做一些更改,为此我找到了两个方法: 1.使用Deface 2.通过覆盖视图
目前,我正在覆盖视图,但有人建议这种方法不是很好。我想使用deface,但无法应用它:
Deface::Override.new(:virtual_path => "spree/checkout/registration",
:insert_before => "div#registration",
:text => "<p>Registration is the future!</p>",
:name => "registration_future")请帮助我如何优化我的视图?
提前感谢
发布于 2012-08-29 07:40:12
通过在项目的app/overrides文件夹中使用代码创建拼音文件,可以使用Deface替换内容并插入新内容。
/app
/overrides
future_registration.rbfuture_registration.rb将包含您粘贴的代码。如果您在重新启动服务器后访问url spree/checkout/registration,您应该会在页面中看到消息。
https://stackoverflow.com/questions/11470023
复制相似问题