This commit is contained in:
albert
2010-10-08 18:42:26 -04:00
parent 6bc469b05d
commit f051e04550
88 changed files with 2865 additions and 699 deletions

View File

@@ -12,6 +12,16 @@ module ApplicationHelper
def format_text(text, options = {})
DText.parse(text)
end
def error_messages_for(instance_name)
instance = instance_variable_get("@#{instance_name}")
if instance.errors.any?
%{<div class="error-messages"><h1>There were errors</h1><p>#{instance.__send__(:errors).full_messages.join(", ")}</div>}.html_safe
else
""
end
end
protected
def nav_link_match(controller, url)