Validation Error Messages not Displaying - Ruby on Rails

ErrorsRuby on RailsWeb Development

Just another quick problem I ran into, the validation was indicating that an error had occurred however it did not show what the error was:

1 error prohibited this message from being saved:

— Usually an error would appear here —

Turns out the problem was pretty straight forward – it’s always the little things! I’d simply missed the each when displaying the error messages:

  
    <div id="error_explanation">
       <h2> prohibited this message from being saved:</h2>
       <ul>
         
         
         <li>
           
         </li>
         
       </ul>
    </div>
  

Simply adding the correct code fixed the problem straight away.

1 error prohibited this message from being saved:

Country can’t be blank

Good Luck!