aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/base
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2009-05-23 00:17:05 +0200
committerPratik Naik <pratiknaik@gmail.com>2009-05-23 00:17:10 +0200
commite976c489e6416cdc4714721df78dd43dd6d13d99 (patch)
treec5e5c96ef0bd5cd522ddc492a527e53685a0d58b /actionpack/lib/action_controller/base
parent1d168afcb146872cb7e49b6d513629fbb19e39b0 (diff)
downloadrails-e976c489e6416cdc4714721df78dd43dd6d13d99.tar.gz
rails-e976c489e6416cdc4714721df78dd43dd6d13d99.tar.bz2
rails-e976c489e6416cdc4714721df78dd43dd6d13d99.zip
Add all the existing helpers related features to the new base
Diffstat (limited to 'actionpack/lib/action_controller/base')
-rw-r--r--actionpack/lib/action_controller/base/helpers.rb22
1 files changed, 9 insertions, 13 deletions
diff --git a/actionpack/lib/action_controller/base/helpers.rb b/actionpack/lib/action_controller/base/helpers.rb
index ba65032f6a..96fa7896a9 100644
--- a/actionpack/lib/action_controller/base/helpers.rb
+++ b/actionpack/lib/action_controller/base/helpers.rb
@@ -3,23 +3,19 @@ require 'active_support/dependencies'
# FIXME: helper { ... } is broken on Ruby 1.9
module ActionController #:nodoc:
module Helpers #:nodoc:
- def self.included(base)
+ extend ActiveSupport::DependencyModule
+
+ included do
# Initialize the base module to aggregate its helpers.
- base.class_inheritable_accessor :master_helper_module
- base.master_helper_module = Module.new
+ class_inheritable_accessor :master_helper_module
+ self.master_helper_module = Module.new
# Set the default directory for helpers
- base.class_inheritable_accessor :helpers_dir
- base.helpers_dir = (defined?(RAILS_ROOT) ? "#{RAILS_ROOT}/app/helpers" : "app/helpers")
-
- # Extend base with class methods to declare helpers.
- base.extend(ClassMethods)
+ class_inheritable_accessor :helpers_dir
+ self.helpers_dir = (defined?(RAILS_ROOT) ? "#{RAILS_ROOT}/app/helpers" : "app/helpers")
- base.class_eval do
- # Wrap inherited to create a new master helper module for subclasses.
- class << self
- alias_method_chain :inherited, :helper
- end
+ class << self
+ alias_method_chain :inherited, :helper
end
end