What is the preferred way to display validation error messages using form_for in Rails 4?
form_for
<%= form_for @post do |f| %> ... <% end %&g
This is how I am displaying them for my form object called @location:
@location:
<% if @location.errors.any? %> <% @location.errors.full_messages.each do |msg| %> <%= msg %> <% end %> <% end %>
Note: put the above code after the <%= form_for @location do |f| %> line
<%= form_for @location do |f| %>