Reputation: 1691
Is there a way to conditionally set a deface override, for example based on product?
So product == 'x', then do it, otherwise, ignore.
Upvotes: 0
Views: 806
Reputation: 4911
Your best bet will be to conditionally use render_original like so:
Deface::Override.new(:virtual_path => "products",
:name => "example",
:surround => "div#products",
:text => "<% if @product == 'x' %><%# do something %><% else %><%= render_original %><% end %>")
Upvotes: 4