method
compile_template
v1.0.0 -
Show latest stable
-
0 notes -
Class: ActionView::Base
- 1.0.0 (0)
- 1.1.6 (0)
- 1.2.6 (38)
- 2.0.3 (0)
- 2.1.0
- 2.2.1
- 2.3.8
- 3.0.0
- 3.0.9
- 3.1.0
- 3.2.1
- 3.2.8
- 3.2.13
- 4.0.2
- 4.1.8
- 4.2.1
- 4.2.7
- 4.2.9
- 5.0.0.1
- 5.1.7
- 5.2.3
- 6.0.0
- 6.1.3.1
- 6.1.7.7
- 7.0.0
- 7.1.3.2
- 7.1.3.4
- What's this?
compile_template(extension, template, file_name, local_assigns)
private
Hide source
# File actionpack/lib/action_view/base.rb, line 412 def compile_template(extension, template, file_name, local_assigns) method_key = file_name || template render_symbol = @@method_names[method_key] || assign_method_name(extension, template, file_name) render_source = create_template_source(extension, template, render_symbol, local_assigns.keys) line_offset = @@template_args[render_symbol].size line_offset += 2 if extension && (extension.to_sym == :rxml) begin unless file_name.blank? CompiledTemplates.module_eval(render_source, file_name, -line_offset) else CompiledTemplates.module_eval(render_source, 'compiled-template', -line_offset) end rescue Object => e if logger logger.debug "ERROR: compiling #{render_symbol} RAISED #{e}" logger.debug "Function body: #{render_source}" logger.debug "Backtrace: #{e.backtrace.join("\n")}" end raise TemplateError.new(@base_path, method_key, @assigns, template, e) end @@compile_time[render_symbol] = Time.now # logger.debug "Compiled template #{method_key}\n ==> #{render_symbol}" if logger end