I want to run this block only a condition is satisfied
<% if condition %>
<% progressive_render do %>
SLOW CODE HERE
<% end %>
<% end %>
IF condition = true
SLOW CODE should be runnned wrapped by "progressive_render"
IF condition = true
SLOW CODE shoud be runned not wrapped by progressive_render. So runned anyway.
You can replace the
if-else
condition with a guard clause (plusunless
condition):