<% if flash[:error] == question.question_id && answer.try(:errors) %>
<% answer.errors.messages[:answer].each do |message| %>
<div class="error"><%= message %></div>
<% end %>