This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% if @entry.errors.include?(:state) %> | |
<div class="control-group"> | |
<div class="controls"> | |
<div class="error"> <%= @entry.errors["state"][0] %></div> | |
</div> | |
</div> | |
<% end %> | |
###############OR | |
#in application rb | |
Include the errors in the html fields | |
ActionView::Base.field_error_proc = Proc.new do |html_tag, instance| | |
"<div class=\"field_with_errors\"> | |
#{html_tag} | |
<div class=\"error\">#{instance.error_message.first}</div> | |
</div>".html_safe | |
end |
No comments:
Post a Comment