<div>
  <h2><%= @question.title %></h2><br>
  by: <%= @question.user.username %><br>
  posted: <%= @question.created_at %><br>
  <div>
    <p>
      <%= @question.body %>
    </p><br>
    <a href="/questions/<%= @question.id %>/comments">Add a comment</a>
  </div>
  <br><br>
 <p><a href="/answers/new">Add an answer</a>
 <form action="/questions/<%= @question.id %>/vote" method="post">
 <input type="submit" value="upvote" name= "vote">
 <input type="submit" value="downvote" name="vote">
 <span>score: <%= @score %></span>
 </form>
  </p>
  <br><br>
  <h3>All answers:</h3>
  <% @answers.each do |answer| %>
    <h4><%= answer.body %></h4><br>
    posted: <%= answer.created_at %><br>
    by: <%= answer.user.username %><br><br>
    <%= answer.body %><br>
  <% end %>

</div>

<div>
  <h2><%= @question.title %></h2><br>
  by: <%= @question.user.username %><br>
  posted: <%= @question.created_at %><br>
  <div>
    <p>
      <%= @question.body %>
    </p><br>
    <a href="/questions/<%= @question.id %>/comments">Add a comment</a>
  </div>
  <br><br>
 <p><a href="/answers/new">Add an answer</a>
 <form action="/questions/<%= @question.id %>/vote" method="post">
 <input type="submit" value="upvote" name= "vote">
 <input type="submit" value="downvote" name="vote">
 <span>score: <%= @score %></span>
 </form>
  </p>
  <br><br>
  <h3>All answers:</h3>
  <% @answers.each do |answer| %>
    <h4><%= answer.body %></h4><br>
    posted: <%= answer.created_at %><br>
    by: <%= answer.user.username %><br><br>
    <%= answer.body %><br>
    <a href="/answers/<%= answer.id %>/comments">Add a comment</a>
    <form action="/answers/<%= answer.id %>/vote" method="post">
      <input type="submit" value="upvote" name= "vote">
      <input type="submit" value="downvote" name="vote">
      <span>score: <%= answer.votes.reduce(0) { |score, vote| score += vote.value } %></span>
    </form>
  <% end %>

</div>

Complete voting feature for answers
Complete voting feature for answers
