From 7a5a84ba9c8648cd6fe5eeb9af2ada56118d8b57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Thu, 3 Aug 2017 16:39:43 -0400 Subject: Remove duplicated convert_direct_upload_option_to_url FormHelper includes FormTagHelper so we don't need to define two methods --- actionview/lib/action_view/helpers/form_helper.rb | 6 ------ actionview/lib/action_view/helpers/form_tag_helper.rb | 5 ++++- 2 files changed, 4 insertions(+), 7 deletions(-) (limited to 'actionview/lib/action_view') diff --git a/actionview/lib/action_view/helpers/form_helper.rb b/actionview/lib/action_view/helpers/form_helper.rb index ac42de053c..8b6322f8ad 100644 --- a/actionview/lib/action_view/helpers/form_helper.rb +++ b/actionview/lib/action_view/helpers/form_helper.rb @@ -2316,12 +2316,6 @@ module ActionView options[:include_id] = !options.delete(:skip_id) end end - - def convert_direct_upload_option_to_url(options) - if options.delete(:direct_upload) - options['data-direct-upload-url'] = rails_direct_uploads_url - end - end end end diff --git a/actionview/lib/action_view/helpers/form_tag_helper.rb b/actionview/lib/action_view/helpers/form_tag_helper.rb index fd7184f8d3..2519ff2837 100644 --- a/actionview/lib/action_view/helpers/form_tag_helper.rb +++ b/actionview/lib/action_view/helpers/form_tag_helper.rb @@ -906,7 +906,10 @@ module ActionView end def convert_direct_upload_option_to_url(options) - options.merge('data-direct-upload-url': options.delete(:direct_upload) && respond_to?(:rails_direct_uploads_url) ? rails_direct_uploads_url : nil).compact + if options.delete(:direct_upload) && respond_to?(:rails_direct_uploads_url) + options["data-direct-upload-url"] = rails_direct_uploads_url + end + options end end end -- cgit v1.2.3