Method to create the source code for a given template.
Source Code
# File action_view/base.rb, line 560 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
<code/>and<pre/>for code samples.