rtopitt/bolao2014

View on GitHub
app/views/questions/index.html.erb

Summary

Maintainability
Test Coverage
<% content_for(:title) { Question.model_name.human(count: 2) } %>

<div class="row">
  <div class="small-12 column">
    <h2><%= Question.model_name.human(count: 2) %></h2>
  </div>
</div>

<div class="row">
  <div class="small-12 column">
    <table>
      <tbody>
        <% @questions.each do |question| %>
          <tr>
            <td><%= link_to "##{question.number}", question_path(question) %></td>
            <td class="text-left hide-for-small-only"><%= question.body %></td>
            <td class="text-left"><%= question.answer_text_or_? %></td>
            <td class="hide-for-small-only">
              <%= link_to t('.view'), question_path(question) %>
              <% if admin_logged_in? %>
                <%= link_to t('.edit'), edit_admin_question_path(question), class: 'admin-action' %>
              <% end %>
            </td>
          </tr>
        <% end %>
      </tbody>
    </table>
  </div>
</div>