./lib/jbuilder_template.rb in jbuilder-0.8.1 vs ./lib/jbuilder_template.rb in jbuilder-0.8.2
- old
+ new
@@ -7,12 +7,12 @@
def partial!(options, locals = {})
case options
when ::Hash
options[:locals] ||= {}
options[:locals].merge!(:json => self)
- @context.render(options)
- else
- @context.render(options, locals.merge(:json => self))
+ @context.render(options.reverse_merge(:formats => [:json]))
+ else # String
+ @context.render(:partial => options, :locals => locals.merge(:json => self), :formats => [:json])
end
end
# Caches the json constructed within the block passed. Has the same signature as the `cache` helper
# method in `ActionView::Helpers::CacheHelper` and so can be used in the same way.