diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2010-05-31 13:48:47 -0500 |
---|---|---|
committer | Mikel Lindsaar <raasdnil@gmail.com> | 2010-06-03 23:32:10 +1000 |
commit | 19d1d42daf64021221a558d6e33dfb46dddc8bfe (patch) | |
tree | 338ee75045f724dabc089e8b167fe292c87ffcc8 | |
parent | de50ba22380207aec3ab424efc0b2d1323334617 (diff) | |
download | rails-19d1d42daf64021221a558d6e33dfb46dddc8bfe.tar.gz rails-19d1d42daf64021221a558d6e33dfb46dddc8bfe.tar.bz2 rails-19d1d42daf64021221a558d6e33dfb46dddc8bfe.zip |
Base options cant live in lazy loaded helpers as they then wont be available to set for config
-rw-r--r-- | actionpack/lib/action_view/base.rb | 4 | ||||
-rw-r--r-- | actionpack/lib/action_view/helpers/active_model_helper.rb | 7 |
2 files changed, 4 insertions, 7 deletions
diff --git a/actionpack/lib/action_view/base.rb b/actionpack/lib/action_view/base.rb index 735398d972..f4af763afe 100644 --- a/actionpack/lib/action_view/base.rb +++ b/actionpack/lib/action_view/base.rb @@ -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 diff --git a/actionpack/lib/action_view/helpers/active_model_helper.rb b/actionpack/lib/action_view/helpers/active_model_helper.rb index 0cddd09eb0..8054de0af6 100644 --- a/actionpack/lib/action_view/helpers/active_model_helper.rb +++ b/actionpack/lib/action_view/helpers/active_model_helper.rb @@ -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| |