Replaced .count by .length to omit one SQL query.
Slightly rearranged the display.
This commit is contained in:
parent
110cd16d6e
commit
df39fba0ba
1 changed files with 5 additions and 2 deletions
|
|
@ -1,12 +1,15 @@
|
|||
<%# Show search results %>
|
||||
|
||||
<% if @packages.count>0 %>
|
||||
<% if @packages.length>0 %>
|
||||
<ul>
|
||||
<% @packages.each do |package| %>
|
||||
<h2><%= package.name %></h2>
|
||||
<li>
|
||||
<%= package.name %>
|
||||
(<%= package.description %>)
|
||||
<% if package.screenshots.length>0 %>
|
||||
<%= image_tag package.screenshots.first.image_url('small') %>
|
||||
<% else %>
|
||||
<em>No screenshot. :( Care to upload one?</em>
|
||||
<% end %>
|
||||
</li>
|
||||
<% end %>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue