Files

SimpleForm::Components::Errors

Public Instance Methods

error() click to toggle source
# File lib/simple_form/components/errors.rb, line 4
def error
  template.content_tag(error_tag, error_text, error_html_options) if has_errors?
end
error_html_options() click to toggle source
# File lib/simple_form/components/errors.rb, line 20
def error_html_options
  html_options_for(:error, [:error])
end
error_method() click to toggle source
# File lib/simple_form/components/errors.rb, line 16
def error_method
  options[:error_method] || SimpleForm.error_method
end
error_tag() click to toggle source
# File lib/simple_form/components/errors.rb, line 8
def error_tag
  options[:error_tag] || SimpleForm.error_tag
end
error_text() click to toggle source
# File lib/simple_form/components/errors.rb, line 12
def error_text
  errors.send(error_method)
end

Protected Instance Methods

errors() click to toggle source
# File lib/simple_form/components/errors.rb, line 30
def errors
  @errors ||= (errors_on_attribute + errors_on_association).compact
end
errors_on_association() click to toggle source
# File lib/simple_form/components/errors.rb, line 38
def errors_on_association
  reflection ? object.errors[reflection.name] : []
end
errors_on_attribute() click to toggle source
# File lib/simple_form/components/errors.rb, line 34
def errors_on_attribute
  object.errors[attribute_name]
end
has_errors?() click to toggle source
# File lib/simple_form/components/errors.rb, line 26
def has_errors?
  object && errors.present?
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.