This commit is contained in:
albert
2013-03-05 17:45:42 -05:00
parent d912ba6172
commit 84cb2b9ec1
2 changed files with 3 additions and 1 deletions

View File

@@ -49,7 +49,7 @@ module ApplicationHelper
instance = instance_variable_get("@#{instance_name}")
if instance && instance.errors.any?
%{<div class="error-messages ui-state-error ui-corner-all"><span class="ui-icon ui-icon-alert"></span> <strong>Error</strong>: #{instance.__send__(:errors).full_messages.join(", ")}</div>}.html_safe
%{<div class="error-messages ui-state-error ui-corner-all"><strong>Error</strong>: #{instance.__send__(:errors).full_messages.join(", ")}</div>}.html_safe
else
""
end

View File

@@ -2,6 +2,8 @@
<div id="a-edit">
<h1>Edit Comment</h1>
<%= error_messages_for "comment" %>
<%= simple_form_for(@comment) do |f| %>
<%= dtext_field "comment", "body" %>
<%= f.button :submit, "Submit" %>