Skip to content

Commit ea037ff

Browse files
author
David Heinemeier Hansson
committed
Base options cant live in lazy loaded helpers as they then wont be available to set for config
1 parent 1854209 commit ea037ff

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

actionpack/lib/action_view/base.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,10 @@ module Subclasses
165165
cattr_accessor :debug_rjs
166166
@@debug_rjs = false
167167

168+
# Specify the proc used to decorate input tags that refer to attributes with errors.
169+
cattr_accessor :field_error_proc
170+
@@field_error_proc = Proc.new{ |html_tag, instance| "<div class=\"field_with_errors\">#{html_tag}</div>".html_safe }
171+
168172
class_attribute :helpers
169173
remove_method :helpers
170174
attr_reader :helpers

actionpack/lib/action_view/helpers/active_model_helper.rb

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,6 @@
44
require 'active_support/core_ext/object/blank'
55

66
module ActionView
7-
ActiveSupport.on_load(:action_view) do
8-
class ActionView::Base
9-
@@field_error_proc = Proc.new{ |html_tag, instance| "<div class=\"field_with_errors\">#{html_tag}</div>".html_safe }
10-
cattr_accessor :field_error_proc
11-
end
12-
end
13-
147
module Helpers
158
module ActiveModelHelper
169
%w(input form error_messages_for error_message_on).each do |method|

0 commit comments

Comments
 (0)