4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/fredit/template30.rb', line 4
def render(view, locals, &block)
ActiveSupport::Notifications.instrument("!render_template.action_view", :virtual_path => @virtual_path) do
if view.is_a?(ActionView::CompiledTemplates)
mod = ActionView::CompiledTemplates
else
mod = view.singleton_class
end
method_name = compile(locals, view, mod)
r = view.send(method_name, locals, &block)
Fredit.add_fredit_link(self, r)
end
rescue Exception => e
if e.is_a?(Template::Error)
e.sub_template_of(self)
raise e
else
raise Template::Error.new(self, view.respond_to?(:assigns) ? view.assigns : {}, e)
end
end
|