Skip to content

Instantly share code, notes, and snippets.

@roykolak
Created September 16, 2011 19:29
Show Gist options
  • Save roykolak/1222913 to your computer and use it in GitHub Desktop.
Save roykolak/1222913 to your computer and use it in GitHub Desktop.
module Specialists::UsersHelper
def check_for_errors(field_error, &block)
if field_error.blank?
block.call
else
haml_tag :div, :class => 'field_with_errors' do
block.call
end
end
end
def simple_form_errors_message(errors)
if !errors.empty?
haml_tag :div, :class => 'errorExplanation' do
haml_tag :p do
haml_concat "Please correct the highlighted fields."
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment