instance method
render_template_part
Ruby on Rails 2.2.3
Since v2.2.3 Last seen in v2.3.18 PrivateAvailable in: v2.2.3 v2.3.18
Signature
render_template_part(template_options)
No documentation comment.
Parameters
-
template_optionsreq
Source
# File railties/lib/rails_generator/commands.rb, line 137
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
Defined in railties/lib/rails_generator/commands.rb line 137
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in Rails::Generator::Commands::Base