Method deprecated or moved
This method is deprecated or moved on the latest stable version.
The last existing version (v2.1.0) is shown here.
create_template_source(template, render_symbol)
private
Method to create the source code for a given template.
# File actionpack/lib/action_view/template_handlers/compilable.rb, line 97
def create_template_source(template, render_symbol)
body = compile(template)
self.template_args[render_symbol] ||= {}
locals_keys = self.template_args[render_symbol].keys | template.locals.keys
self.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