Source: show | on GitHub
# File actionpack/lib/action_view/helpers/active_model_helper.rb, line 35 35: def error_message 36: object.errors[@method_name] 37: end
# File actionpack/lib/action_view/helpers/active_model_helper.rb, line 27 27: def error_wrapping(html_tag) 28: if object_has_errors? 29: Base.field_error_proc.call(html_tag, self) 30: else 31: html_tag 32: end 33: end
# File actionpack/lib/action_view/helpers/active_model_helper.rb, line 12 12: def object 13: @active_model_object ||= begin 14: object = super 15: object.respond_to?(:to_model) ? object.to_model : object 16: end 17: end
# File actionpack/lib/action_view/helpers/active_model_helper.rb, line 23 23: def tag(type, options, *) 24: tag_generate_errors?(options) ? error_wrapping(super) : super 25: end