aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/base.rb
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2010-03-08 16:32:40 +0100
committerJosé Valim <jose.valim@gmail.com>2010-03-08 16:32:40 +0100
commit68cda695da27f57cae682d160a13dab4dacb1ef8 (patch)
tree3a3aedb66bc64e4e70220b3f051cd71356373226 /actionpack/lib/action_view/base.rb
parent44ebab96da0ab47cc45c64a6efdd2cbb80f9d042 (diff)
downloadrails-68cda695da27f57cae682d160a13dab4dacb1ef8.tar.gz
rails-68cda695da27f57cae682d160a13dab4dacb1ef8.tar.bz2
rails-68cda695da27f57cae682d160a13dab4dacb1ef8.zip
Speed up performance in resolvers by adding fallbacks just when required.
Diffstat (limited to 'actionpack/lib/action_view/base.rb')
-rw-r--r--actionpack/lib/action_view/base.rb46
1 files changed, 18 insertions, 28 deletions
diff --git a/actionpack/lib/action_view/base.rb b/actionpack/lib/action_view/base.rb
index d18f524060..d2b77b2560 100644
--- a/actionpack/lib/action_view/base.rb
+++ b/actionpack/lib/action_view/base.rb
@@ -173,48 +173,41 @@ module ActionView #:nodoc:
module Subclasses
end
- include Helpers, Rendering, Partials, Layouts, ::ERB::Util
-
- extend ActiveSupport::Memoizable
-
- attr_accessor :base_path, :assigns, :template_extension
- attr_internal :captures
-
- class << self
- delegate :erb_trim_mode=, :to => 'ActionView::Template::Handlers::ERB'
- delegate :logger, :to => 'ActionController::Base', :allow_nil => true
- end
+ include Helpers, Rendering, Partials, Layouts, ::ERB::Util, Context
+ extend ActiveSupport::Memoizable
# Specify whether RJS responses should be wrapped in a try/catch block
# that alert()s the caught exception (and then re-raises it).
cattr_accessor :debug_rjs
@@debug_rjs = false
- # :nodoc:
- def self.xss_safe?
- true
+ class_attribute :helpers
+ attr_reader :helpers
+
+ class << self
+ delegate :erb_trim_mode=, :to => 'ActionView::Template::Handlers::ERB'
+ delegate :logger, :to => 'ActionController::Base', :allow_nil => true
end
- attr_internal :request, :layout
+ attr_accessor :base_path, :assigns, :template_extension, :lookup_context
+ attr_internal :captures, :request, :layout, :controller, :template, :config
- def controller_path
- @controller_path ||= controller && controller.controller_path
- end
+ delegate :find_template, :template_exists?, :formats, :formats=,
+ :view_paths, :view_paths=, :with_fallbacks, :update_details, :to => :lookup_context
delegate :request_forgery_protection_token, :template, :params, :session, :cookies, :response, :headers,
:flash, :action_name, :controller_name, :to => :controller
delegate :logger, :to => :controller, :allow_nil => true
- include Context
+ def self.xss_safe? #:nodoc:
+ true
+ end
def self.process_view_paths(value)
ActionView::PathSet.new(Array(value))
end
- class_attribute :helpers
- attr_reader :helpers
-
def self.for_controller(controller)
@views ||= {}
@@ -260,12 +253,9 @@ module ActionView #:nodoc:
@lookup_context.formats = formats if formats
end
- attr_internal :controller, :template, :config
-
- attr_reader :lookup_context
-
- delegate :find_template, :template_exists?, :formats, :formats=,
- :view_paths, :view_paths=, :update_details, :to => :lookup_context
+ def controller_path
+ @controller_path ||= controller && controller.controller_path
+ end
def punctuate_body!(part)
flush_output_buffer