Project

General

Profile

Patch #43428 » 0002-Fix-for-https-github.com-rails-rails-pull-55404.patch

Takashi Kato, 2025-11-02 02:10

View differences:

app/helpers/application_helper.rb
fields_for(*args, &)
end
def form_tag_html(html_options)
# Set a randomized name attribute on all form fields by default
# as a workaround to https://bugzilla.mozilla.org/show_bug.cgi?id=1279253
html_options['name'] ||= "#{html_options['id'] || 'form'}-#{SecureRandom.hex(4)}"
super
end
# Render the error messages for the given objects
def error_messages_for(*objects)
objects = objects.filter_map {|o| o.is_a?(String) ? instance_variable_get(:"@#{o}") : o}
config/initializers/10-patches.rb
super
end
end)
module Helpers
# Set a randomized name attribute on all form fields by default
# as a workaround to https://bugzilla.mozilla.org/show_bug.cgi?id=1279253
FormHelper.prepend(Module.new do
def form_tag_html(html_options)
randomized_name_attribute(html_options)
super
end
def form_tag_with_body(html_options, output)
randomized_name_attribute(html_options)
super
end
def randomized_name_attribute(html_options)
html_options['name'] ||= "#{html_options['id'] || 'form'}-#{SecureRandom.hex(4)}"
end
end)
end
end
module ActionController
(2-2/3)