提交 19d1d42d 编写于 作者: D David Heinemeier Hansson 提交者: Mikel Lindsaar

Base options cant live in lazy loaded helpers as they then wont be available to set for config

上级 de50ba22
......@@ -165,6 +165,10 @@ module Subclasses
cattr_accessor :debug_rjs
@@debug_rjs = false
# Specify the proc used to decorate input tags that refer to attributes with errors.
cattr_accessor :field_error_proc
@@field_error_proc = Proc.new{ |html_tag, instance| "<div class=\"field_with_errors\">#{html_tag}</div>".html_safe }
class_attribute :helpers
remove_method :helpers
attr_reader :helpers
......
......@@ -4,13 +4,6 @@
require 'active_support/core_ext/object/blank'
module ActionView
ActiveSupport.on_load(:action_view) do
class ActionView::Base
@@field_error_proc = Proc.new{ |html_tag, instance| "<div class=\"field_with_errors\">#{html_tag}</div>".html_safe }
cattr_accessor :field_error_proc
end
end
module Helpers
module ActiveModelHelper
%w(input form error_messages_for error_message_on).each do |method|
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册