Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法有条件地设置污损覆盖,例如基于产品?
所以product == 'x',那就做吧,否则,忽略。
你最好的选择是有条件地使用 render_original 像这样:
Deface::Override.new(:virtual_path => "products", :name => "example", :surround => "div#products", :text => "<% if @product == 'x' %><%# do something %><% else %><%= render_original %><% end %>")