@@ -55,7 +55,9 @@ def partial!(*args)
55
55
if args . one? && _is_active_model? ( args . first )
56
56
_render_active_model_partial args . first
57
57
else
58
- _render_explicit_partial ( *args )
58
+ options = args . extract_options! . dup
59
+ options [ :partial ] = args . first if args . present?
60
+ _render_partial_with_options options
59
61
end
60
62
end
61
63
@@ -248,28 +250,6 @@ def _set_inline_partial(name, object, options)
248
250
_set_value name , value
249
251
end
250
252
251
- def _render_explicit_partial ( name_or_options , locals = { } )
252
- case name_or_options
253
- when ::Hash
254
- # partial! partial: 'name', foo: 'bar'
255
- options = name_or_options
256
- else
257
- # partial! 'name', locals: {foo: 'bar'}
258
- if locals . one? && ( locals . keys . first == :locals )
259
- locals [ :partial ] = name_or_options
260
- options = locals
261
- else
262
- options = { partial : name_or_options , locals : locals }
263
- end
264
- # partial! 'name', foo: 'bar'
265
- as = locals . delete ( :as )
266
- options [ :as ] = as if as . present?
267
- options [ :collection ] = locals [ :collection ] if locals . key? ( :collection )
268
- end
269
-
270
- _render_partial_with_options options
271
- end
272
-
273
253
def _render_active_model_partial ( object )
274
254
@context . render object , json : self
275
255
end
0 commit comments