8000 remove rails 6.1 conditional code · activeadmin/activeadmin@70c3438 · GitHub
[go: up one dir, main page]

Skip to content

Commit 70c3438

Browse files
committed
remove rails 6.1 conditional code
1 parent 36a8a12 commit 70c3438

File tree

2 files changed

+2
-15
lines changed

2 files changed

+2
-15
lines changed

lib/active_admin/views/components/active_admin_form.rb

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -132,23 +132,11 @@ def build(form_builder, *args, &block)
132132
legend = args.shift if args.first.is_a?(::String)
133133
legend = html_options.delete(:name) if html_options.key?(:name)
134134
legend_tag = legend ? helpers.tag.legend(legend, class: "fieldset-title") : ""
135-
fieldset_attrs = tag_attributes html_options
135+
fieldset_attrs = helpers.tag.attributes html_options
136136
@opening_tag = "<fieldset #{fieldset_attrs}>#{legend_tag}<ol>"
137137
@closing_tag = "</ol></fieldset>"
138138
super(*(args << html_options), &block)
139139
end
140-
141-
private
142-
143-
def tag_attributes(html_options)
144-
if Rails::VERSION::MAJOR <= 6
145-
# Reimplement tag.attributes to backport support for Rails 6.1.
146-
# TODO: this can be removed when support for Rails 6.x is dropped
147-
helpers.tag.tag_options(html_options.to_h).to_s.strip.html_safe
148-
else
149-
helpers.tag.attributes html_options
150-
end
151-
end
152140
end
153141

154142
class SemanticActionsProxy < FormtasticProxy

spec/support/templates/views/admin/posts/_starred_batch_action_form.html.erb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
</button>
1919
<div class="px-6 py-6 lg:px-8">
2020
<h3 class="mb-4 text-xl font-medium text-gray-900 dark:text-white">Toggle Starred</h3>
21-
<% form_action = (Rails::VERSION::MAJOR >= 7) ? false : {} %>
22-
<%= form_tag form_action, "data-batch-action-form": "" do %>
21+
<%= form_tag false, "data-batch-action-form": "" do %>
2322
<div class="py-6 flex items-center gap-2">
2423
<input name="starred" id="starred-checkbox" type="checkbox" value="true" class="w-4 h-4 border border-gray-300 rounded bg-gray-50 focus:ring-3 focus:ring-blue-300 dark:bg-gray-600 dark:border-gray-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 dark:focus:ring-offset-gray-800" />
2524
<label for="starred-checkbox" class="text-gray-900 dark:text-gray-300">Starred</label>

0 commit comments

Comments
 (0)
0