| Class | ActionView::Template::Path |
| In: |
vendor/rails/actionpack/lib/action_view/template.rb
|
| Parent: | Object |
| path | [R] | |
| paths | [R] |
# File vendor/rails/actionpack/lib/action_view/template.rb, line 7
7: def initialize(path)
8: raise ArgumentError, "path already is a Path class" if path.is_a?(Path)
9: @path = (path.ends_with?(File::SEPARATOR) ? path.to(-2) : path).freeze
10: end
# File vendor/rails/actionpack/lib/action_view/template.rb, line 47
47: def self.new_and_loaded(path)
48: returning new(path) do |path|
49: path.load!
50: end
51: end
# File vendor/rails/actionpack/lib/action_view/template.rb, line 24
24: def ==(path)
25: to_str == path.to_str
26: end
Returns a ActionView::Template object for the given path string. The input path should be relative to the view path directory, +hello/index.html.erb+. This method also has a special exception to match partial file names without a handler extension. So +hello/index.html+ will match the first template it finds with a known template extension, +hello/index.html.erb+. Template extensions should not be confused with format extensions html, js, xml, etc. A format must be supplied to match a formated file. +hello/index+ will never match +hello/index.html.erb+.
# File vendor/rails/actionpack/lib/action_view/template.rb, line 41
41: def [](path)
42: end
# File vendor/rails/actionpack/lib/action_view/template.rb, line 28
28: def eql?(path)
29: to_str == path.to_str
30: end