diff --git a/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb b/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb index 55f40fe204555fe7129a3a9c0bda88d17deadd2c..dd2cbdcddcff01c2347025900a973b17b12626a8 100644 --- a/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb +++ b/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb @@ -135,7 +135,9 @@ def polymorphic_url(record_or_hash_or_array, options = {}) named_route = build_named_route_call(record_or_hash_or_array, record, inflection, options) url_options = options.except(:action, :routing_type) - args << url_options + unless url_options.empty? + args << url_options + end args.collect! { |a| convert_to_model(a) }