holderdeord/hdo-site

View on GitHub
app/views/votes/propositions.html.erb

Summary

Maintainability
Test Coverage
<div class="row-fluid">
  <div class="muted"><%= t('app.counts.propositions', count: @propositions.size).html_safe %></div>

  <% if @layout %>

    <table class="table">
      <thead>
        <tr>
          <th>Id</th>
          <th><%= Proposition.human_attribute_name :body %></th>
        </tr>
      </thead>

      <tbody>
        <% @propositions.each do |prop| %>
          <tr>
            <td><%= prop.id %></td>
            <td style="background-color: #f5f5f5;"><%= prop.body.html_safe %></td>
          </tr>
        <% end %>
      </tbody>
    </table>

  <% else %>
    <%# admin search view %>
    <% @propositions.each do |prop| %>
      <%= prop.body.html_safe %>
    <% end %>
  <% end %>
</div>