method
render_template_part
render_template_part(template_options)
private
Hide source
# File railties/lib/rails_generator/commands.rb, line 138 def render_template_part(template_options) # Getting Sandbox to evaluate part template in it part_binding = template_options[:sandbox].call.sandbox_binding part_rel_path = template_options[:insert] part_path = source_path(part_rel_path) # Render inner template within Sandbox binding rendered_part = ERB.new(File.readlines(part_path).join, nil, '-').result(part_binding) begin_mark = template_part_mark(template_options[:begin_mark], template_options[:mark_id]) end_mark = template_part_mark(template_options[:end_mark], template_options[:mark_id]) begin_mark + rendered_part + end_mark end