improves banners helper
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
module BannersHelper
|
||||
|
||||
def has_banners
|
||||
@banners.count > 0
|
||||
def has_banners?
|
||||
@banners.present? && @banners.count > 0
|
||||
end
|
||||
|
||||
end
|
||||
@@ -27,7 +27,7 @@
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% if has_banners %>
|
||||
<% if has_banners? %>
|
||||
<%= render "shared/banner" %>
|
||||
<% end %>
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% if has_banners %>
|
||||
<% if has_banners? %>
|
||||
<%= render "shared/banner" %>
|
||||
<% end %>
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<% banner = @banners.sample%>
|
||||
<% banner = @banners.sample %>
|
||||
<div class="<%= banner.style %>">
|
||||
<div class="<%= banner.image %>">
|
||||
<%= link_to banner.target_url do %>
|
||||
<h2><%=banner.title%></h2>
|
||||
<h3><%=banner.description%></h3>
|
||||
<h2><%=banner.title %></h2>
|
||||
<h3><%=banner.description %></h3>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user