diff options
Diffstat (limited to 'actionview/lib')
6 files changed, 13 insertions, 18 deletions
diff --git a/actionview/lib/action_view/gem_version.rb b/actionview/lib/action_view/gem_version.rb index 5bed37583e..011662d8d1 100644 --- a/actionview/lib/action_view/gem_version.rb +++ b/actionview/lib/action_view/gem_version.rb @@ -8,9 +8,9 @@ module ActionView module VERSION MAJOR = 6 - MINOR = 0 + MINOR = 1 TINY = 0 - PRE = "beta3" + PRE = "alpha" STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".") end diff --git a/actionview/lib/action_view/helpers/tags/base.rb b/actionview/lib/action_view/helpers/tags/base.rb index b58e1a6680..39c01f3334 100644 --- a/actionview/lib/action_view/helpers/tags/base.rb +++ b/actionview/lib/action_view/helpers/tags/base.rb @@ -106,7 +106,7 @@ module ActionView end def tag_name(multiple = false, index = nil) - # a little duplication to construct less strings + # a little duplication to construct fewer strings case when @object_name.empty? "#{sanitized_method_name}#{multiple ? "[]" : ""}" @@ -118,7 +118,7 @@ module ActionView end def tag_id(index = nil) - # a little duplication to construct less strings + # a little duplication to construct fewer strings case when @object_name.empty? sanitized_method_name.dup diff --git a/actionview/lib/action_view/renderer/abstract_renderer.rb b/actionview/lib/action_view/renderer/abstract_renderer.rb index 475452f1bb..b397c02cde 100644 --- a/actionview/lib/action_view/renderer/abstract_renderer.rb +++ b/actionview/lib/action_view/renderer/abstract_renderer.rb @@ -59,11 +59,10 @@ module ActionView end class RenderedTemplate # :nodoc: - attr_reader :body, :layout, :template + attr_reader :body, :template - def initialize(body, layout, template) + def initialize(body, template) @body = body - @layout = layout @template = template end @@ -97,8 +96,8 @@ module ActionView @lookup_context.formats = formats | @lookup_context.formats end - def build_rendered_template(content, template, layout = nil) - RenderedTemplate.new content, layout, template + def build_rendered_template(content, template) + RenderedTemplate.new content, template end def build_rendered_collection(templates, spacer) diff --git a/actionview/lib/action_view/renderer/partial_renderer.rb b/actionview/lib/action_view/renderer/partial_renderer.rb index ed8d5cf54e..608e417583 100644 --- a/actionview/lib/action_view/renderer/partial_renderer.rb +++ b/actionview/lib/action_view/renderer/partial_renderer.rb @@ -305,7 +305,7 @@ module ActionView else @template_keys = @locals.keys end - template = find_partial(@path, @template_keys) + template = find_template(@path, @template_keys) @variable ||= template.variable else if options[:cached] @@ -364,7 +364,7 @@ module ActionView content = layout.render(view, locals) { content } if layout payload[:cache_hit] = view.view_renderer.cache_hits[template.virtual_path] - build_rendered_template(content, template, layout) + build_rendered_template(content, template) end end @@ -428,10 +428,6 @@ module ActionView @object.to_ary if @object.respond_to?(:to_ary) end - def find_partial(path, template_keys) - find_template(path, template_keys) - end - def find_template(path, locals) prefixes = path.include?(?/) ? [] : @lookup_context.prefixes @lookup_context.find_template(path, prefixes, true, locals, @details) @@ -455,7 +451,7 @@ module ActionView content = template.render(view, locals) content = layout.render(view, locals) { content } if layout partial_iteration.iterate! - build_rendered_template(content, template, layout) + build_rendered_template(content, template) end end diff --git a/actionview/lib/action_view/renderer/template_renderer.rb b/actionview/lib/action_view/renderer/template_renderer.rb index 4aab3f913f..4cd8fc5bb2 100644 --- a/actionview/lib/action_view/renderer/template_renderer.rb +++ b/actionview/lib/action_view/renderer/template_renderer.rb @@ -71,7 +71,7 @@ module ActionView else content end - build_rendered_template(body, template, layout) + build_rendered_template(body, template) end # This is the method which actually finds the layout using details in the lookup diff --git a/actionview/lib/action_view/test_case.rb b/actionview/lib/action_view/test_case.rb index e14f7aaec7..3a75633743 100644 --- a/actionview/lib/action_view/test_case.rb +++ b/actionview/lib/action_view/test_case.rb @@ -284,7 +284,7 @@ module ActionView def respond_to_missing?(name, include_private = false) begin - routes = @controller.respond_to?(:_routes) && @controller._routes + routes = defined?(@controller) && @controller.respond_to?(:_routes) && @controller._routes rescue # Don't call routes, if there is an error on _routes call end |