lib/phlex/rails/sgml.rb in phlex-rails-1.2.0 vs lib/phlex/rails/sgml.rb in phlex-rails-1.2.1
- old
+ new
@@ -27,11 +27,14 @@
when Class
return super if renderable < Phlex::SGML
when Enumerable
return super unless renderable.is_a?(ActiveRecord::Relation)
else
- captured_block = -> { capture(&block) } if block
- @_context.target << @_view_context.render(*args, **kwargs, &captured_block)
+ if block
+ @_context.target << @_view_context.render(*args, **kwargs) { capture(&block) }
+ else
+ @_context.target << @_view_context.render(*args, **kwargs)
+ end
end
nil
end