1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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

This commit is contained in:
David Heinemeier Hansson 2010-05-31 13:48:47 -05:00
parent 1854209bb3
commit ea037ff557
2 changed files with 4 additions and 7 deletions

View file

@ -165,6 +165,10 @@ module ActionView #:nodoc:
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

View file

@ -4,13 +4,6 @@ require 'active_support/core_ext/enumerable'
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|