lib/motorhead/action_view.rb in motorhead-0.2.0 vs lib/motorhead/action_view.rb in motorhead-0.3.0
- old
+ new
@@ -2,15 +2,16 @@
#FIXME FIXHAML AMCing here because prepending on `render` causes infinite loop when Haml is bundled
def render_with_motorhead(options = {}, locals = {}, &block)
if (Hash === options) && options.key?(:engine)
ext_name = options[:engine][/[^\/]*/]
if ext_name.classify.constantize::Engine.active? controller
- return view_renderer.render(self, options, &block)
- else
- return capture(&block)
+ view_renderer.render(self, options, &block)
+ elsif block
+ capture(&block)
end
+ else
+ render_without_motorhead options, locals, &block
end
- render_without_motorhead options, locals, &block
end
alias_method_chain :render, :motorhead
end