1
0
Fork 0
mirror of https://github.com/kbparagua/paloma synced 2023-03-27 23:21:17 -04:00

only include hook if partial is available. Removes conflict with jbuilder and also resolves bug #37

This commit is contained in:
Juerg Ritter 2014-08-19 15:24:55 +02:00
parent 7da1bf66e4
commit c556ffdb12

View file

@ -116,9 +116,14 @@ module Paloma
def append_paloma_hook
return true if self.paloma.has_no_request?
hook = view_context.render(
:partial => 'paloma/hook',
:locals => {:request => self.paloma.request})
# Render the partial if it is present, otherwise do nothing.
begin
hook = view_context.render(
:partial => 'paloma/hook',
:locals => {:request => self.paloma.request})
rescue ActionView::MissingTemplate
return true
end
before_body_end_index = response_body[0].rindex('</body>')