method
create_template_source
rails latest stable - Class:
ActionView::Base
Method deprecated or moved
This method is deprecated or moved on the latest stable version. The last existing version (v2.0.3) is shown here.
create_template_source(handler, template, render_symbol, locals)private
Method to create the source code for a given template.
# File actionpack/lib/action_view/base.rb, line 578
def create_template_source(handler, template, render_symbol, locals)
body = delegate_compile(handler, template)
@@template_args[render_symbol] ||= {}
locals_keys = @@template_args[render_symbol].keys | locals
@@template_args[render_symbol] = locals_keys.inject({}) { |h, k| h[k] = true; h }
locals_code = ""
locals_keys.each do |key|
locals_code << "#{key} = local_assigns[:#{key}]\n"
end
"def #{render_symbol}(local_assigns)\n#{locals_code}#{body}\nend"
end Related methods
- Instance methods
- append_view_path
- full_template_path
- prepend_view_path
- template_format
- Class methods
- handler_for_extension
- register_default_template_handler
- register_template_handler
- template_handler_extensions
- Private methods
-
assign_method_name -
assign_variables_from_controller -
compile_template -
compile_template? -
compiled_method_name -
compiled_method_name_file_path_segment -
create_template_source -
delegate_compile -
delegate_render -
evaluate_assigns -
extract_base_path_from -
find_base_path_for -
find_full_template_path -
find_template_extension_for -
find_template_extension_from_first_render -
find_template_extension_from_handler -
path_and_extension -
read_template_file -
supports_local_assigns? -
template_changed_since? -
template_exists? -
template_handler_is_compilable? -
wrap_content_for_layout