Methods
Included Modules
Classes and Modules
Class ActionView::Template::EagerPath
Class ActionView::Template::Path
Attributes
[RW] base_path
[RW] extension
[RW] filename
[RW] format
[RW] load_path
[RW] locale
[RW] name
[RW] template_path
Public Class methods
exempt_from_layout(*extensions)

Don‘t render layouts for templates with the given extensions.

     # File actionpack/lib/action_view/template.rb, line 99
 99:     def self.exempt_from_layout(*extensions)
100:       regexps = extensions.collect do |extension|
101:         extension.is_a?(Regexp) ? extension : /\.#{Regexp.escape(extension.to_s)}$/
102:       end
103:       @@exempt_from_layout.merge(regexps)
104:     end
new(template_path, load_path)
     # File actionpack/lib/action_view/template.rb, line 110
110:     def initialize(template_path, load_path)
111:       @template_path = template_path.dup
112:       @load_path, @filename = load_path, File.join(load_path, template_path)
113:       @base_path, @name, @locale, @format, @extension = split(template_path)
114:       @base_path.to_s.gsub!(/\/$/, '') # Push to split method
115: 
116:       # Extend with partial super powers
117:       extend RenderablePartial if @name =~ /^_/
118:     end
Public Instance methods
accessible_paths()
     # File actionpack/lib/action_view/template.rb, line 120
120:     def accessible_paths
121:       paths = []
122: 
123:       if valid_extension?(extension)
124:         paths << path
125:         paths << path_without_extension
126:         if multipart?
127:           formats = format.split(".")
128:           paths << "#{path_without_format_and_extension}.#{formats.first}"
129:           paths << "#{path_without_format_and_extension}.#{formats.second}"
130:         end
131:       else
132:         # template without explicit template handler should only be reachable through its exact path
133:         paths << template_path
134:       end
135: 
136:       paths
137:     end
content_type()
     # File actionpack/lib/action_view/template.rb, line 148
148:     def content_type
149:       format.gsub('.', '/')
150:     end
exempt_from_layout?()
     # File actionpack/lib/action_view/template.rb, line 179
179:     def exempt_from_layout?
180:       @@exempt_from_layout.any? { |exempted| path =~ exempted }
181:     end
format_and_extension()
     # File actionpack/lib/action_view/template.rb, line 139
139:     def format_and_extension
140:       (extensions = [format, extension].compact.join(".")).blank? ? nil : extensions
141:     end
load!()
     # File actionpack/lib/action_view/template.rb, line 205
205:     def load!
206:       freeze
207:     end
method_segment()
     # File actionpack/lib/action_view/template.rb, line 188
188:     def method_segment
189:       relative_path.to_s.gsub(/([^a-zA-Z0-9_])/) { $1.ord }
190:     end
mime_type()
     # File actionpack/lib/action_view/template.rb, line 152
152:     def mime_type
153:       Mime::Type.lookup_by_extension(format) if format && defined?(::Mime)
154:     end
multipart?()
     # File actionpack/lib/action_view/template.rb, line 144
144:     def multipart?
145:       format && format.include?('.')
146:     end
path()
     # File actionpack/lib/action_view/template.rb, line 157
157:     def path
158:       [base_path, [name, locale, format, extension].compact.join('.')].compact.join('/')
159:     end
path_without_extension()
     # File actionpack/lib/action_view/template.rb, line 162
162:     def path_without_extension
163:       [base_path, [name, locale, format].compact.join('.')].compact.join('/')
164:     end
path_without_format_and_extension()
     # File actionpack/lib/action_view/template.rb, line 167
167:     def path_without_format_and_extension
168:       [base_path, [name, locale].compact.join('.')].compact.join('/')
169:     end
relative_path()
     # File actionpack/lib/action_view/template.rb, line 172
172:     def relative_path
173:       path = File.expand_path(filename)
174:       path.sub!(/^#{Regexp.escape(File.expand_path(RAILS_ROOT))}\//, '') if defined?(RAILS_ROOT)
175:       path
176:     end
render_template(view, local_assigns = {})
     # File actionpack/lib/action_view/template.rb, line 193
193:     def render_template(view, local_assigns = {})
194:       render(view, local_assigns)
195:     rescue Exception => e
196:       raise e unless filename
197:       if TemplateError === e
198:         e.sub_template_of(self)
199:         raise e
200:       else
201:         raise TemplateError.new(self, view.assigns, e)
202:       end
203:     end
source()
     # File actionpack/lib/action_view/template.rb, line 183
183:     def source
184:       File.read(filename)
185:     end