diff --git a/lib/props_template/layout_patch.rb b/lib/props_template/layout_patch.rb index 0611598..9153100 100644 --- a/lib/props_template/layout_patch.rb +++ b/lib/props_template/layout_patch.rb @@ -10,18 +10,9 @@ def render_template(view, template, layout_name, locals) end def render_props_template(view, template, path, locals) - view.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 - def virtual_path_of_template;"#{template.virtual_path}";end - RUBY - - # Deprecated: Usage of virtual_path_of_template in local_assigns will - # be removed for a method definition above - layout_locals = locals.dup - layout_locals[:virtual_path_of_template] = template.virtual_path - - layout = resolve_layout(path, layout_locals.keys, [formats.first]) + layout = resolve_layout(path, locals.keys, [formats.first]) body = if layout - layout.render(view, layout_locals) do |json| + layout.render(view, locals) do |json| template.render(view, locals) end else