Method deprecated
This method is deprecated on the latest stable version of Rails.
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.
Show source
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