使用Deface查看覆盖

时间:2012-08-09 12:06:26

标签: spree

我正在尝试在Spree产品页面的显示页面上插入文字。

我的app /覆盖/ show_new.html.erb如下:

Deface::Override.new(:virtual_path  => "spree/products/show",
                 :insert_after => "[data-hook='product_show']",
                 :text          => "<p>This is overriding......</p>",
                 :name          => "show_new",
                 :disabled      => false) 

但是,视图没有被覆盖。我错过了什么吗?

1 个答案:

答案 0 :(得分:0)

您必须重新启动应用才能覆盖首先注册。

否则,这似乎是正确的(假设您的代码在app / overrides / something.rb中)

请注意,如果您没有使用最新版本,那么某些视图HTML会被破坏并且会破坏。

https://github.com/spree/spree/issues/1056(上周我遇到过这个问题)

相关问题