To avoid always writing if has_banners? every time the partial is used it has been moved within this partial.
7 lines
279 B
Plaintext
7 lines
279 B
Plaintext
<% if has_banners? || controller.class == Admin::BannersController %>
|
|
<% banner ||= @banners.sample %>
|
|
<div class="banner" style="background-color:<%= banner.background_color %>;">
|
|
<%= sanitize banner_target_link(banner), attributes: %w[href style] %>
|
|
</div>
|
|
<% end %>
|