aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/base.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_view/base.rb')
-rw-r--r--actionpack/lib/action_view/base.rb15
1 files changed, 10 insertions, 5 deletions
diff --git a/actionpack/lib/action_view/base.rb b/actionpack/lib/action_view/base.rb
index e83c8b6bd3..12dd7d2bc9 100644
--- a/actionpack/lib/action_view/base.rb
+++ b/actionpack/lib/action_view/base.rb
@@ -1,6 +1,9 @@
module ActionView #:nodoc:
class ActionViewError < StandardError #:nodoc:
end
+
+ class MissingTemplate < ActionViewError #:nodoc:
+ end
# Action View templates can be written in three ways. If the template file has a +.erb+ (or +.rhtml+) extension then it uses a mixture of ERb
# (included in Ruby) and HTML. If the template file has a +.builder+ (or +.rxml+) extension then Jim Weirich's Builder::XmlMarkup library is used.
@@ -202,15 +205,17 @@ module ActionView #:nodoc:
class ObjectWrapper < Struct.new(:value) #:nodoc:
end
- def self.load_helpers #:nodoc:
- Dir.entries("#{File.dirname(__FILE__)}/helpers").sort.each do |file|
+ def self.helper_modules #:nodoc:
+ helpers = []
+ Dir.entries(File.expand_path("#{File.dirname(__FILE__)}/helpers")).sort.each do |file|
next unless file =~ /^([a-z][a-z_]*_helper).rb$/
require "action_view/helpers/#{$1}"
helper_module_name = $1.camelize
if Helpers.const_defined?(helper_module_name)
- include Helpers.const_get(helper_module_name)
+ helpers << Helpers.const_get(helper_module_name)
end
end
+ return helpers
end
def initialize(view_paths = [], assigns_for_first_render = {}, controller = nil)#:nodoc:
@@ -279,7 +284,7 @@ If you are rendering a subtemplate, you must now use controller-like partial syn
elsif options[:partial]
render_partial(options[:partial], ActionView::Base::ObjectWrapper.new(options[:object]), options[:locals])
elsif options[:inline]
- template = Template.new(self, options[:inline], false, options[:locals], true, options[:type])
+ template = InlineTemplate.new(self, options[:inline], options[:locals], options[:type])
render_template(template)
end
end
@@ -320,7 +325,7 @@ If you are rendering a subtemplate, you must now use controller-like partial syn
end
end
- private
+ private
def wrap_content_for_layout(content)
original_content_for_layout = @content_for_layout
@content_for_layout = content