From 8f082ff4217175f52234f2223658619a9c923afc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Mon, 8 Mar 2010 23:13:24 +0100 Subject: Clean LookupContext API. --- actionpack/lib/abstract_controller/rendering.rb | 2 +- actionpack/lib/abstract_controller/view_paths.rb | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'actionpack/lib/abstract_controller') diff --git a/actionpack/lib/abstract_controller/rendering.rb b/actionpack/lib/abstract_controller/rendering.rb index 77c554fa3f..5048754e33 100644 --- a/actionpack/lib/abstract_controller/rendering.rb +++ b/actionpack/lib/abstract_controller/rendering.rb @@ -97,7 +97,7 @@ module AbstractController end if (options.keys & [:partial, :file, :template]).empty? - options[:_prefix] ||= _prefix + options[:prefix] ||= _prefix end options[:template] ||= (options[:action] || action_name).to_s diff --git a/actionpack/lib/abstract_controller/view_paths.rb b/actionpack/lib/abstract_controller/view_paths.rb index ec8f31cdfe..6513c0778e 100644 --- a/actionpack/lib/abstract_controller/view_paths.rb +++ b/actionpack/lib/abstract_controller/view_paths.rb @@ -7,8 +7,7 @@ module AbstractController self._view_paths = ActionView::PathSet.new end - delegate :find_template, :template_exists?, - :view_paths, :formats, :formats=, :to => :lookup_context + delegate :template_exists?, :view_paths, :formats, :formats=, :to => :lookup_context # LookupContext is the object responsible to hold all information required to lookup # templates, i.e. view paths and details. Check ActionView::LookupContext for more @@ -29,6 +28,10 @@ module AbstractController lookup_context.view_paths.unshift(*path) end + def template_exists?(*args) + lookup_context.exists?(*args) + end + module ClassMethods # Append a path to the list of view paths for this controller. # -- cgit v1.2.3