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