aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/render
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2010-03-08 02:58:16 +0100
committerJosé Valim <jose.valim@gmail.com>2010-03-08 02:58:16 +0100
commit4bae77a89baf0fee15c6b2cfd3987f7344b56a1f (patch)
tree07ff2cc5b6dfb4ec54708fcf34bdd843d44c5fa7 /actionpack/lib/action_view/render
parentffd8d753f171a33cb0f8dadaff7fc5ba12b8f6b0 (diff)
downloadrails-4bae77a89baf0fee15c6b2cfd3987f7344b56a1f.tar.gz
rails-4bae77a89baf0fee15c6b2cfd3987f7344b56a1f.tar.bz2
rails-4bae77a89baf0fee15c6b2cfd3987f7344b56a1f.zip
More cleanup on the layouts side.
Diffstat (limited to 'actionpack/lib/action_view/render')
-rw-r--r--actionpack/lib/action_view/render/partials.rb13
-rw-r--r--actionpack/lib/action_view/render/rendering.rb10
2 files changed, 6 insertions, 17 deletions
diff --git a/actionpack/lib/action_view/render/partials.rb b/actionpack/lib/action_view/render/partials.rb
index 52cb188508..eecc88a1e0 100644
--- a/actionpack/lib/action_view/render/partials.rb
+++ b/actionpack/lib/action_view/render/partials.rb
@@ -182,9 +182,6 @@ module ActionView
@view = view_context
@partial_names = PARTIAL_NAMES[@view.controller.class]
- key = Thread.current[:format_locale_key]
- @templates = TEMPLATES[key] if key
-
setup(options, block)
end
@@ -296,15 +293,9 @@ module ActionView
end
end
- def find_template(path = @path)
- unless @templates
- path && _find_template(path)
- else
- path && @templates[path] ||= _find_template(path)
- end
- end
+ def find_template(path=@path)
+ return path unless path.is_a?(String)
- def _find_template(path)
if controller = @view.controller
prefix = controller.controller_path unless path.include?(?/)
end
diff --git a/actionpack/lib/action_view/render/rendering.rb b/actionpack/lib/action_view/render/rendering.rb
index b92a03ddbd..17fb110eb4 100644
--- a/actionpack/lib/action_view/render/rendering.rb
+++ b/actionpack/lib/action_view/render/rendering.rb
@@ -34,7 +34,6 @@ module ActionView
end
if template
- layout = find(layout) if layout
_render_template(template, layout, :locals => options[:locals])
end
when :update
@@ -92,13 +91,12 @@ module ActionView
_render_template(template, layout, options)
end
- def _find_layout(template, layout)
+ def _find_layout(layout)
begin
- prefix = "layouts" unless layout =~ /\blayouts/
- layout = find(layout, prefix)
+ find(layout)
rescue ActionView::MissingTemplate => e
update_details(:formats => nil) do
- raise unless template_lookup.exists?(layout, prefix)
+ raise unless template_lookup.exists?(layout)
end
end
end
@@ -107,7 +105,7 @@ module ActionView
self.formats = template.details[:formats]
locals = options[:locals] || {}
- layout = _find_layout(template, layout) if layout.is_a?(String)
+ layout = _find_layout(layout) if layout
ActiveSupport::Notifications.instrument("action_view.render_template",
:identifier => template.identifier, :layout => layout.try(:identifier)) do