Is this the correct way of rendering a yield content_for?

64 Views Asked by At
<%= yield(:title_box) if content_for?(:title_box) %>

Or is the if condition useless here?

1

There are 1 best solutions below

0
On BEST ANSWER

The condition check is not needed as if nothing to render there is nothing will be outputted. See docs