aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/template.rb
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2008-07-02 21:38:58 -0500
committerJoshua Peek <josh@joshpeek.com>2008-07-02 21:38:58 -0500
commit3b3790a4351ba7c9d2711089c21f24fcedc11fc0 (patch)
tree5b51c79d8493bcbc42879933af1d3bbb8084f014 /actionpack/lib/action_view/template.rb
parent6c0edef26ee1c0e5f0964cae64c9f48da6daf1fa (diff)
downloadrails-3b3790a4351ba7c9d2711089c21f24fcedc11fc0.tar.gz
rails-3b3790a4351ba7c9d2711089c21f24fcedc11fc0.tar.bz2
rails-3b3790a4351ba7c9d2711089c21f24fcedc11fc0.zip
Deprecate :use_full_path render option. The supplying the option no longer has an effect.
Diffstat (limited to 'actionpack/lib/action_view/template.rb')
-rw-r--r--actionpack/lib/action_view/template.rb39
1 files changed, 21 insertions, 18 deletions
diff --git a/actionpack/lib/action_view/template.rb b/actionpack/lib/action_view/template.rb
index 4c3f252c10..0cba1942f7 100644
--- a/actionpack/lib/action_view/template.rb
+++ b/actionpack/lib/action_view/template.rb
@@ -5,15 +5,19 @@ module ActionView #:nodoc:
attr_accessor :locals
attr_reader :handler, :path, :extension, :filename, :method
- def initialize(view, path, use_full_path, locals = {})
+ def initialize(view, path, use_full_path = nil, locals = {})
+ unless use_full_path == nil
+ ActiveSupport::Deprecation.warn("use_full_path option has been deprecated and has no affect.", caller)
+ end
+
@view = view
@paths = view.view_paths
@original_path = path
- @path = TemplateFile.from_path(path, !use_full_path)
+ @path = TemplateFile.from_path(path)
@view.first_render ||= @path.to_s
@source = nil # Don't read the source until we know that it is required
- set_extension_and_file_name(use_full_path)
+ set_extension_and_file_name
@locals = locals || {}
@handler = self.class.handler_class_for_extension(@extension).new(@view)
@@ -63,25 +67,24 @@ module ActionView #:nodoc:
end
private
- def set_extension_and_file_name(use_full_path)
+ def set_extension_and_file_name
@extension = @path.extension
- if use_full_path
- unless @extension
- @path = @view.send(:template_file_from_name, @path)
- raise_missing_template_exception unless @path
- @extension = @path.extension
- end
-
- if @path = @paths.find_template_file_for_path(path)
- @filename = @path.full_path
- @extension = @path.extension
- end
- else
- @filename = @path.full_path
+ unless @extension
+ @path = @view.send(:template_file_from_name, @path)
+ raise_missing_template_exception unless @path
+ @extension = @path.extension
end
- raise_missing_template_exception if @filename.blank?
+ if p = @paths.find_template_file_for_path(path)
+ @path = p
+ @filename = @path.full_path
+ @extension = @path.extension
+ raise_missing_template_exception if @filename.blank?
+ else
+ @filename = @original_path
+ raise_missing_template_exception unless File.exist?(@filename)
+ end
end
def raise_missing_template_exception