Sha256: 20c0bfeec49dd5e54a4ecbe398aa227029d89b7eb72aa069c77ed05a1630cb26

Contents?: true

Size: 1.41 KB

Versions: 3

Compression:

Stored size: 1.41 KB

Contents

<h3><%= Beer.count %> Beers</h3>
<!-- todo: add display/page count e.g. 25 -->

<table>
<% @beers.each do |beer| %>
<tr>
  <td class='beer-key'><%= beer.key %></td>
  
<% if signed_in? %>
  <td>
     <%= link_to 'Add', add_beer_to_user_path( beer.id, current_user_id ), class: 'btn' %>
  </td>
<% end %>
  
  <td><%= link_to beer.title, beer_path( beer.id ) %>
     <% if beer.synonyms.present? %>
       | <%= beer.synonyms %>
     <% end %>
     /
     <% if beer.abv.present? %>
       <%= beer.abv %>
     <% else %>
       -
     <% end %>
      %
     <% if beer.plato.present? %>
     &bull; <%= beer.plato %>°
     <% end %>
     
     //
     <% if beer.brewery.present? %>
       <%= beer.brewery.title %>
     <% else %>
       -
     <% end %>
     
<% if beer.tags.count > 0 %>
    <br>
    <span class='tags'>
    <% beer.tags.each_with_index do |tag,i| %>
      <% if i > 0 %>
         &bull; 
       <% end %>
       <%= tag.key %>
    <% end %>
    </span>
<% end %>
     
  </td>
  <td>
    <% if beer.city.present? %>
      <%= beer.city.title %>
    <% else %>
      -
    <% end %>
    /
    <% if beer.region.present? %>
      <%= beer.region.title %>
    <% else %>
      -
    <% end %>
    /
     <%= image_tag_for_country( beer.country ) %>
     <%= link_to beer.country.title, short_country_path( beer.country ) %>
   </td>
</tr>

<% end %>
</table>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
beerdb-admin-0.1.1 app/views/beer_db_admin/beers/index.html.erb
beerdb-admin-0.1.0 app/views/beer_db_admin/beers/index.html.erb
beerdb-admin-0.0.1 app/views/beer_db_admin/beers/index.html.erb