aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/renderer/template_renderer.rb
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-04-15 21:11:54 +0200
committerJosé Valim <jose.valim@gmail.com>2011-04-15 21:11:54 +0200
commitd6bd606bddf8c385508aa4ee699bdd5f6eab635a (patch)
tree27809249d3aa6c938eca7e364f4578ccf9cf7b73 /actionpack/lib/action_view/renderer/template_renderer.rb
parentd5ad92ced1786b742c3ecce3cb60d851c7200bc9 (diff)
downloadrails-d6bd606bddf8c385508aa4ee699bdd5f6eab635a.tar.gz
rails-d6bd606bddf8c385508aa4ee699bdd5f6eab635a.tar.bz2
rails-d6bd606bddf8c385508aa4ee699bdd5f6eab635a.zip
render :once, YAGNI.
Diffstat (limited to 'actionpack/lib/action_view/renderer/template_renderer.rb')
-rw-r--r--actionpack/lib/action_view/renderer/template_renderer.rb25
1 files changed, 0 insertions, 25 deletions
diff --git a/actionpack/lib/action_view/renderer/template_renderer.rb b/actionpack/lib/action_view/renderer/template_renderer.rb
index 9ae1636131..439a661dd3 100644
--- a/actionpack/lib/action_view/renderer/template_renderer.rb
+++ b/actionpack/lib/action_view/renderer/template_renderer.rb
@@ -1,17 +1,9 @@
-require 'set'
require 'active_support/core_ext/object/try'
require 'active_support/core_ext/array/wrap'
require 'action_view/renderer/abstract_renderer'
module ActionView
class TemplateRenderer < AbstractRenderer #:nodoc:
- attr_reader :rendered
-
- def initialize(view)
- super
- @rendered = Set.new
- end
-
def render(options)
wrap_formats(options[:template] || options[:file]) do
template = determine_template(options)
@@ -19,23 +11,6 @@ module ActionView
end
end
- def render_once(options)
- paths, locals = options[:once], options[:locals] || {}
- layout, keys = options[:layout], locals.keys
- prefixes = options.fetch(:prefixes, @view.controller_prefixes)
-
- raise "render :once expects a String or an Array to be given" unless paths
-
- render_with_layout(layout, locals) do
- contents = []
- Array.wrap(paths).each do |path|
- template = find_template(path, prefixes, false, keys)
- contents << render_template(template, nil, locals) if @rendered.add?(template)
- end
- contents.join("\n")
- end
- end
-
# Determine the template to be rendered using the given options.
def determine_template(options) #:nodoc:
keys = options[:locals].try(:keys) || []