activeadmin 2.7.0 → 2.8.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of activeadmin might be problematic. Click here for more details.

Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +54 -8
  3. data/CONTRIBUTING.md +1 -17
  4. data/app/assets/javascripts/active_admin/base.js +13 -15
  5. data/app/assets/stylesheets/active_admin/components/_comments.scss +2 -2
  6. data/app/javascript/active_admin/initializers/per-page.js +1 -1
  7. data/app/javascript/active_admin/lib/checkbox-toggler.js +3 -3
  8. data/app/javascript/active_admin/lib/dropdown-menu.js +1 -1
  9. data/app/javascript/active_admin/lib/modal-dialog.js +7 -7
  10. data/app/javascript/active_admin/lib/per-page.js +1 -1
  11. data/app/javascript/active_admin/lib/table-checkbox-toggler.js +1 -1
  12. data/app/views/layouts/active_admin_logged_out.html.erb +2 -2
  13. data/config/locales/ar.yml +6 -6
  14. data/config/locales/es-MX.yml +2 -1
  15. data/config/locales/es.yml +2 -2
  16. data/config/locales/it.yml +18 -0
  17. data/config/locales/ja.yml +3 -3
  18. data/docs/11-decorators.md +16 -5
  19. data/docs/Gemfile.lock +36 -26
  20. data/lib/active_admin.rb +43 -43
  21. data/lib/active_admin/application.rb +6 -6
  22. data/lib/active_admin/authorization_adapter.rb +3 -3
  23. data/lib/active_admin/base_controller/authorization.rb +9 -9
  24. data/lib/active_admin/batch_actions/controller.rb +3 -3
  25. data/lib/active_admin/batch_actions/views/batch_action_form.rb +1 -1
  26. data/lib/active_admin/batch_actions/views/batch_action_selector.rb +5 -5
  27. data/lib/active_admin/collection_decorator.rb +31 -0
  28. data/lib/active_admin/csv_builder.rb +4 -4
  29. data/lib/active_admin/dependency.rb +7 -7
  30. data/lib/active_admin/filters.rb +1 -1
  31. data/lib/active_admin/filters/forms.rb +3 -3
  32. data/lib/active_admin/filters/resource_extension.rb +1 -1
  33. data/lib/active_admin/form_builder.rb +5 -5
  34. data/lib/active_admin/helpers/optional_display.rb +2 -2
  35. data/lib/active_admin/inputs/filters/base/search_method_select.rb +2 -2
  36. data/lib/active_admin/menu_item.rb +7 -7
  37. data/lib/active_admin/namespace.rb +7 -7
  38. data/lib/active_admin/orm/active_record/comments.rb +11 -11
  39. data/lib/active_admin/orm/active_record/comments/comment.rb +3 -3
  40. data/lib/active_admin/orm/active_record/comments/views/active_admin_comments.rb +3 -3
  41. data/lib/active_admin/pundit_adapter.rb +4 -4
  42. data/lib/active_admin/resource/action_items.rb +1 -1
  43. data/lib/active_admin/resource/menu.rb +4 -4
  44. data/lib/active_admin/resource/naming.rb +3 -3
  45. data/lib/active_admin/resource/routes.rb +5 -5
  46. data/lib/active_admin/resource/scope_to.rb +7 -7
  47. data/lib/active_admin/resource_controller.rb +4 -3
  48. data/lib/active_admin/resource_controller/data_access.rb +1 -1
  49. data/lib/active_admin/resource_controller/decorators.rb +5 -25
  50. data/lib/active_admin/resource_dsl.rb +5 -5
  51. data/lib/active_admin/scope.rb +5 -5
  52. data/lib/active_admin/version.rb +1 -1
  53. data/lib/active_admin/view_factory.rb +16 -16
  54. data/lib/active_admin/view_helpers/breadcrumb_helper.rb +1 -1
  55. data/lib/active_admin/view_helpers/display_helper.rb +3 -3
  56. data/lib/active_admin/view_helpers/fields_for.rb +1 -1
  57. data/lib/active_admin/views/components/attributes_table.rb +2 -2
  58. data/lib/active_admin/views/components/dropdown_menu.rb +2 -2
  59. data/lib/active_admin/views/components/index_list.rb +1 -1
  60. data/lib/active_admin/views/components/menu_item.rb +1 -1
  61. data/lib/active_admin/views/components/paginated_collection.rb +14 -14
  62. data/lib/active_admin/views/components/table_for.rb +10 -10
  63. data/lib/active_admin/views/components/tabs.rb +1 -1
  64. data/lib/active_admin/views/index_as_table.rb +6 -6
  65. data/lib/active_admin/views/pages/base.rb +1 -1
  66. data/lib/active_admin/views/pages/index.rb +8 -8
  67. data/lib/generators/active_admin/assets/templates/active_admin.scss +2 -2
  68. data/lib/generators/active_admin/devise/devise_generator.rb +4 -4
  69. data/lib/generators/active_admin/install/templates/active_admin.rb.erb +2 -2
  70. data/lib/generators/active_admin/resource/resource_generator.rb +1 -1
  71. data/lib/generators/active_admin/webpacker/templates/active_admin.scss +2 -2
  72. metadata +15 -8
@@ -38,10 +38,10 @@ module ActiveAdmin
38
38
  options = args.extract_options!
39
39
  method = args.first
40
40
 
41
- scope_to_config[:method] = block || method
42
- scope_to_config[:association_method] = options[:association_method]
43
- scope_to_config[:if] = options[:if]
44
- scope_to_config[:unless] = options[:unless]
41
+ scope_to_config[:method] = block || method
42
+ scope_to_config[:association_method] = options[:association_method]
43
+ scope_to_config[:if] = options[:if]
44
+ scope_to_config[:unless] = options[:unless]
45
45
 
46
46
  end
47
47
 
@@ -55,10 +55,10 @@ module ActiveAdmin
55
55
 
56
56
  def scope_to_config
57
57
  @scope_to_config ||= {
58
- method: nil,
58
+ method: nil,
59
59
  association_method: nil,
60
- if: nil,
61
- unless: nil
60
+ if: nil,
61
+ unless: nil
62
62
  }
63
63
  end
64
64
 
@@ -1,3 +1,4 @@
1
+ require 'active_admin/collection_decorator'
1
2
  require 'active_admin/resource_controller/action_builder'
2
3
  require 'active_admin/resource_controller/data_access'
3
4
  require 'active_admin/resource_controller/decorators'
@@ -24,13 +25,13 @@ module ActiveAdmin
24
25
  include Streaming
25
26
  include Sidebars
26
27
  include ViewHelpers::DownloadFormatLinksHelper
27
- extend ResourceClassMethods
28
+ extend ResourceClassMethods
28
29
 
29
30
  def self.active_admin_config=(config)
30
31
  if @active_admin_config = config
31
32
  defaults resource_class: config.resource_class,
32
- route_prefix: config.route_prefix,
33
- instance_name: config.resource_name.singular
33
+ route_prefix: config.route_prefix,
34
+ instance_name: config.resource_name.singular
34
35
  end
35
36
  end
36
37
 
@@ -258,7 +258,7 @@ module ActiveAdmin
258
258
  end
259
259
 
260
260
  def collection_applies(options = {})
261
- only = Array(options.fetch(:only, COLLECTION_APPLIES))
261
+ only = Array(options.fetch(:only, COLLECTION_APPLIES))
262
262
  except = Array(options.fetch(:except, []))
263
263
 
264
264
  COLLECTION_APPLIES & only - except
@@ -53,13 +53,8 @@ module ActiveAdmin
53
53
 
54
54
  def self.wrap(decorator)
55
55
  collection_decorator = find_collection_decorator(decorator)
56
-
57
- if draper_collection_decorator? collection_decorator
58
- name = "#{collection_decorator.name} of #{decorator} + ActiveAdmin"
59
- @cache[name] ||= wrap! collection_decorator, name
60
- else
61
- collection_decorator
62
- end
56
+ name = "#{collection_decorator.name} of #{decorator} + ActiveAdmin"
57
+ @cache[name] ||= wrap! collection_decorator, name
63
58
  end
64
59
 
65
60
  private
@@ -68,34 +63,19 @@ module ActiveAdmin
68
63
  ::Class.new parent do
69
64
  delegate :reorder, :page, :current_page, :total_pages, :limit_value,
70
65
  :total_count, :total_pages, :offset, :to_key, :group_values,
71
- :except, :find_each, :ransack
66
+ :except, :find_each, :ransack, to: :object
72
67
 
73
68
  define_singleton_method(:name) { name }
74
69
  end
75
70
  end
76
71
 
77
- # Draper::CollectionDecorator was introduced in 1.0.0
78
- # Draper::Decorator#collection_decorator_class was introduced in 1.3.0
79
72
  def self.find_collection_decorator(decorator)
80
- if Dependency.draper? '>= 1.3.0'
73
+ if decorator.respond_to?(:collection_decorator_class)
81
74
  decorator.collection_decorator_class
82
- elsif Dependency.draper? '>= 1.0.0'
83
- draper_collection_decorator
84
75
  else
85
- decorator
76
+ CollectionDecorator
86
77
  end
87
78
  end
88
-
89
- def self.draper_collection_decorator?(decorator)
90
- decorator && decorator <= draper_collection_decorator
91
- rescue NameError
92
- false
93
- end
94
-
95
- def self.draper_collection_decorator
96
- ::Draper::CollectionDecorator
97
- end
98
-
99
79
  end
100
80
  end
101
81
  end
@@ -183,16 +183,16 @@ module ActiveAdmin
183
183
  # == Before / After Destroy
184
184
  # Called before and after the object is destroyed from the database.
185
185
  #
186
- delegate :before_build, :after_build, to: :controller
187
- delegate :before_create, :after_create, to: :controller
188
- delegate :before_update, :after_update, to: :controller
189
- delegate :before_save, :after_save, to: :controller
186
+ delegate :before_build, :after_build, to: :controller
187
+ delegate :before_create, :after_create, to: :controller
188
+ delegate :before_update, :after_update, to: :controller
189
+ delegate :before_save, :after_save, to: :controller
190
190
  delegate :before_destroy, :after_destroy, to: :controller
191
191
 
192
192
  # This code defines both *_filter and *_action for Rails 5.0 and *_action for Rails >= 5.1
193
193
  phases = [
194
194
  :before, :skip_before,
195
- :after, :skip_after,
195
+ :after, :skip_after,
196
196
  :around, :skip
197
197
  ]
198
198
  keywords = if Rails::VERSION::MAJOR == 5 && Rails::VERSION::MINOR >= 1
@@ -45,11 +45,11 @@ module ActiveAdmin
45
45
  @scope_block = block
46
46
  end
47
47
 
48
- @localizer = options[:localizer]
49
- @show_count = options.fetch(:show_count, true)
50
- @display_if_block = options[:if] || proc { true }
51
- @default_block = options[:default] || proc { false }
52
- @group = options[:group].try(:to_sym)
48
+ @localizer = options[:localizer]
49
+ @show_count = options.fetch(:show_count, true)
50
+ @display_if_block = options[:if] || proc { true }
51
+ @default_block = options[:default] || proc { false }
52
+ @group = options[:group].try(:to_sym)
53
53
  end
54
54
 
55
55
  def name
@@ -1,3 +1,3 @@
1
1
  module ActiveAdmin
2
- VERSION = '2.7.0'
2
+ VERSION = '2.8.0'
3
3
  end
@@ -4,24 +4,24 @@ module ActiveAdmin
4
4
  class ViewFactory < AbstractViewFactory
5
5
 
6
6
  # Register Helper Renderers
7
- register global_navigation: ActiveAdmin::Views::TabbedNavigation,
8
- utility_navigation: ActiveAdmin::Views::TabbedNavigation,
9
- site_title: ActiveAdmin::Views::SiteTitle,
10
- unsupported_browser: ActiveAdmin::Views::UnsupportedBrowser,
11
- action_items: ActiveAdmin::Views::ActionItems,
12
- title_bar: ActiveAdmin::Views::TitleBar,
13
- header: ActiveAdmin::Views::Header,
14
- footer: ActiveAdmin::Views::Footer,
15
- index_scopes: ActiveAdmin::Views::Scopes,
16
- blank_slate: ActiveAdmin::Views::BlankSlate
7
+ register global_navigation: ActiveAdmin::Views::TabbedNavigation,
8
+ utility_navigation: ActiveAdmin::Views::TabbedNavigation,
9
+ site_title: ActiveAdmin::Views::SiteTitle,
10
+ unsupported_browser: ActiveAdmin::Views::UnsupportedBrowser,
11
+ action_items: ActiveAdmin::Views::ActionItems,
12
+ title_bar: ActiveAdmin::Views::TitleBar,
13
+ header: ActiveAdmin::Views::Header,
14
+ footer: ActiveAdmin::Views::Footer,
15
+ index_scopes: ActiveAdmin::Views::Scopes,
16
+ blank_slate: ActiveAdmin::Views::BlankSlate
17
17
 
18
18
  # Register All The Pages
19
- register index_page: ActiveAdmin::Views::Pages::Index,
20
- show_page: ActiveAdmin::Views::Pages::Show,
21
- new_page: ActiveAdmin::Views::Pages::Form,
22
- edit_page: ActiveAdmin::Views::Pages::Form,
23
- layout: ActiveAdmin::Views::Pages::Layout,
24
- page: ActiveAdmin::Views::Pages::Page
19
+ register index_page: ActiveAdmin::Views::Pages::Index,
20
+ show_page: ActiveAdmin::Views::Pages::Show,
21
+ new_page: ActiveAdmin::Views::Pages::Form,
22
+ edit_page: ActiveAdmin::Views::Pages::Form,
23
+ layout: ActiveAdmin::Views::Pages::Layout,
24
+ page: ActiveAdmin::Views::Pages::Page
25
25
 
26
26
  end
27
27
  end
@@ -15,7 +15,7 @@ module ActiveAdmin
15
15
  if part =~ /\A(\d+|[a-f0-9]{24}|(?:[a-f0-9]{8}-(?:[a-f0-9]{4}-){3}[a-f0-9]{12}))\z/ && parts[index - 1]
16
16
  parent = active_admin_config.belongs_to_config.try :target
17
17
  config = parent && parent.resource_name.route_key == parts[index - 1] ? parent : active_admin_config
18
- name = display_name config.find_resource part
18
+ name = display_name config.find_resource part
19
19
  end
20
20
  name ||= I18n.t "activerecord.models.#{part.singularize}", count: ::ActiveAdmin::Helpers::I18n::PLURAL_MANY_COUNT, default: part.titlecase
21
21
 
@@ -5,7 +5,7 @@ module ActiveAdmin
5
5
  DISPLAY_NAME_FALLBACK = -> {
6
6
  name = ""
7
7
  klass = self.class
8
- name << klass.model_name.human if klass.respond_to? :model_name
8
+ name << klass.model_name.human if klass.respond_to? :model_name
9
9
  name << " ##{send(klass.primary_key)}" if klass.respond_to? :primary_key
10
10
  name.present? ? name : to_s
11
11
  }
@@ -26,7 +26,7 @@ module ActiveAdmin
26
26
  @@display_name_methods_cache ||= {}
27
27
  @@display_name_methods_cache[resource.class] ||= begin
28
28
  methods = active_admin_application.display_name_methods - association_methods_for(resource)
29
- method = methods.detect { |method| resource.respond_to? method }
29
+ method = methods.detect { |method| resource.respond_to? method }
30
30
 
31
31
  if method != :to_s || resource.method(method).source_location
32
32
  method
@@ -74,7 +74,7 @@ module ActiveAdmin
74
74
  format_collection(object)
75
75
  else
76
76
  if defined?(::ActiveRecord) && object.is_a?(ActiveRecord::Base) ||
77
- defined?(::Mongoid) && object.class.include?(Mongoid::Document)
77
+ defined?(::Mongoid) && object.class.include?(Mongoid::Document)
78
78
  auto_link object
79
79
  elsif defined?(::ActiveRecord) && object.is_a?(ActiveRecord::Relation)
80
80
  format_collection(object)
@@ -15,7 +15,7 @@ module ActiveAdmin
15
15
  #
16
16
  def fields_for_params(params, options = {})
17
17
  namespace = options[:namespace]
18
- except = Array.wrap(options[:except]).map &:to_s
18
+ except = Array.wrap(options[:except]).map &:to_s
19
19
 
20
20
  params.flat_map do |k, v|
21
21
  next if namespace.nil? && %w(controller action commit utf8).include?(k.to_s)
@@ -5,7 +5,7 @@ module ActiveAdmin
5
5
  builder_method :attributes_table_for
6
6
 
7
7
  def build(obj, *attrs)
8
- @collection = Array.wrap(obj)
8
+ @collection = Array.wrap(obj)
9
9
  @resource_class = @collection.first.class
10
10
  options = {}
11
11
  options[:for] = @collection.first if single_record?
@@ -20,7 +20,7 @@ module ActiveAdmin
20
20
  end
21
21
 
22
22
  def row(*args, &block)
23
- title = args[0]
23
+ title = args[0]
24
24
  options = args.extract_options!
25
25
  classes = [:row]
26
26
  if options[:class]
@@ -35,9 +35,9 @@ module ActiveAdmin
35
35
  super(options)
36
36
  end
37
37
 
38
- def item(*args)
38
+ def item(*args, **kwargs)
39
39
  within @menu do
40
- li link_to(*args)
40
+ li link_to(*args, **kwargs)
41
41
  end
42
42
  end
43
43
 
@@ -37,7 +37,7 @@ module ActiveAdmin
37
37
  def build_index_list(index_class)
38
38
  li class: classes_for_index(index_class) do
39
39
  params = request.query_parameters.except :page, :commit, :format
40
- url_with_params = url_for(params.merge(as: index_class.index_name.to_sym))
40
+ url_with_params = url_for(**params.merge(as: index_class.index_name.to_sym).symbolize_keys)
41
41
 
42
42
  a href: url_with_params, class: "table_tools_button" do
43
43
  name = index_class.index_name
@@ -18,7 +18,7 @@ module ActiveAdmin
18
18
  add_class "current" if item.current? assigns[:current_tab]
19
19
 
20
20
  if url
21
- text_node link_to label, url, item.html_options
21
+ text_node link_to label, url, **item.html_options
22
22
  else
23
23
  span label, item.html_options
24
24
  end
@@ -38,12 +38,12 @@ module ActiveAdmin
38
38
  # download_links => Download links override (false or [:csv, :pdf])
39
39
  #
40
40
  def build(collection, options = {})
41
- @collection = collection
42
- @params = options.delete(:params)
43
- @param_name = options.delete(:param_name)
41
+ @collection = collection
42
+ @params = options.delete(:params)
43
+ @param_name = options.delete(:param_name)
44
44
  @download_links = options.delete(:download_links)
45
- @display_total = options.delete(:pagination_total) { true }
46
- @per_page = options.delete(:per_page)
45
+ @display_total = options.delete(:pagination_total) { true }
46
+ @per_page = options.delete(:per_page)
47
47
 
48
48
  unless collection.respond_to?(:total_pages)
49
49
  raise(StandardError, "Collection is not a paginated scope. Set collection.page(params[:page]).per(10) before calling :paginated_collection.")
@@ -93,7 +93,7 @@ module ActiveAdmin
93
93
 
94
94
  def build_pagination
95
95
  options = { theme: @display_total ? 'active_admin' : 'active_admin_countless' }
96
- options[:params] = @params if @params
96
+ options[:params] = @params if @params
97
97
  options[:param_name] = @param_name if @param_name
98
98
 
99
99
  if !@display_total
@@ -107,7 +107,7 @@ module ActiveAdmin
107
107
  options[:right] = 0
108
108
  end
109
109
 
110
- text_node paginate collection, options
110
+ text_node paginate collection, **options
111
111
  end
112
112
 
113
113
  include ::ActiveAdmin::Helpers::Collection
@@ -116,28 +116,28 @@ module ActiveAdmin
116
116
  # modified from will_paginate
117
117
  def page_entries_info(options = {})
118
118
  if options[:entry_name]
119
- entry_name = options[:entry_name]
119
+ entry_name = options[:entry_name]
120
120
  entries_name = options[:entries_name] || entry_name.pluralize
121
121
  elsif collection_is_empty?
122
- entry_name = I18n.t "active_admin.pagination.entry", count: 1, default: 'entry'
122
+ entry_name = I18n.t "active_admin.pagination.entry", count: 1, default: 'entry'
123
123
  entries_name = I18n.t "active_admin.pagination.entry", count: 2, default: 'entries'
124
124
  else
125
125
  key = "activerecord.models." + collection.first.class.model_name.i18n_key.to_s
126
126
 
127
- entry_name = I18n.translate key, count: 1, default: collection.first.class.name.underscore.sub('_', ' ')
127
+ entry_name = I18n.translate key, count: 1, default: collection.first.class.name.underscore.sub('_', ' ')
128
128
  entries_name = I18n.translate key, count: collection.size, default: entry_name.pluralize
129
129
  end
130
130
 
131
131
  if @display_total
132
132
  if collection.total_pages < 2
133
133
  case collection_size
134
- when 0; I18n.t("active_admin.pagination.empty", model: entries_name)
135
- when 1; I18n.t("active_admin.pagination.one", model: entry_name)
136
- else; I18n.t("active_admin.pagination.one_page", model: entries_name, n: collection.total_count)
134
+ when 0; I18n.t("active_admin.pagination.empty", model: entries_name)
135
+ when 1; I18n.t("active_admin.pagination.one", model: entry_name)
136
+ else; I18n.t("active_admin.pagination.one_page", model: entries_name, n: collection.total_count)
137
137
  end
138
138
  else
139
139
  offset = (collection.current_page - 1) * collection.limit_value
140
- total = collection.total_count
140
+ total = collection.total_count
141
141
  I18n.t "active_admin.pagination.multiple",
142
142
  model: entries_name,
143
143
  total: total,
@@ -8,14 +8,14 @@ module ActiveAdmin
8
8
  end
9
9
 
10
10
  def build(obj, *attrs)
11
- options = attrs.extract_options!
12
- @sortable = options.delete(:sortable)
13
- @collection = obj.respond_to?(:each) && !obj.is_a?(Hash) ? obj : [obj]
11
+ options = attrs.extract_options!
12
+ @sortable = options.delete(:sortable)
13
+ @collection = obj.respond_to?(:each) && !obj.is_a?(Hash) ? obj : [obj]
14
14
  @resource_class = options.delete(:i18n)
15
15
  @resource_class ||= @collection.klass if @collection.respond_to? :klass
16
16
 
17
- @columns = []
18
- @row_class = options.delete(:row_class)
17
+ @columns = []
18
+ @row_class = options.delete(:row_class)
19
19
 
20
20
  build_table
21
21
  super(options)
@@ -29,7 +29,7 @@ module ActiveAdmin
29
29
  def column(*args, &block)
30
30
  options = default_options.merge(args.extract_options!)
31
31
  title = args[0]
32
- data = args[1] || args[0]
32
+ data = args[1] || args[0]
33
33
 
34
34
  col = Column.new(title, data, @resource_class, options, &block)
35
35
  @columns << col
@@ -65,12 +65,12 @@ module ActiveAdmin
65
65
  end
66
66
 
67
67
  def build_table_header(col)
68
- classes = Arbre::HTML::ClassList.new
68
+ classes = Arbre::HTML::ClassList.new
69
69
  sort_key = sortable? && col.sortable? && col.sort_key
70
- params = request.query_parameters.except :page, :order, :commit, :format
70
+ params = request.query_parameters.except :page, :order, :commit, :format
71
71
 
72
- classes << 'sortable' if sort_key
73
- classes << "sorted-#{current_sort[1]}" if sort_key && current_sort[0] == sort_key
72
+ classes << 'sortable' if sort_key
73
+ classes << "sorted-#{current_sort[1]}" if sort_key && current_sort[0] == sort_key
74
74
  classes << col.html_class
75
75
 
76
76
  if sort_key
@@ -32,7 +32,7 @@ module ActiveAdmin
32
32
 
33
33
  def fragmentize(string)
34
34
  result = string.parameterize
35
- result = URI.encode(string) if result.blank?
35
+ result = CGI.escape(string) if result.blank?
36
36
  result
37
37
  end
38
38
  end
@@ -344,9 +344,9 @@ module ActiveAdmin
344
344
  #
345
345
  # ```
346
346
  def actions(options = {}, &block)
347
- name = options.delete(:name) { '' }
348
- defaults = options.delete(:defaults) { true }
349
- dropdown = options.delete(:dropdown) { false }
347
+ name = options.delete(:name) { '' }
348
+ defaults = options.delete(:defaults) { true }
349
+ dropdown = options.delete(:dropdown) { false }
350
350
  dropdown_name = options.delete(:dropdown_name) { I18n.t 'active_admin.dropdown_actions.button_label', default: 'Actions' }
351
351
 
352
352
  options[:class] ||= 'col-actions'
@@ -381,15 +381,15 @@ module ActiveAdmin
381
381
  end
382
382
  if controller.action_methods.include?('destroy') && authorized?(ActiveAdmin::Auth::DESTROY, resource)
383
383
  item localizer.t(:delete), resource_path(resource), class: "delete_link #{options[:css_class]}", title: localizer.t(:delete),
384
- method: :delete, data: { confirm: localizer.t(:delete_confirmation) }
384
+ method: :delete, data: { confirm: localizer.t(:delete_confirmation) }
385
385
  end
386
386
  end
387
387
 
388
388
  class TableActions < ActiveAdmin::Component
389
389
  builder_method :table_actions
390
390
 
391
- def item *args
392
- text_node link_to *args
391
+ def item *args, **kwargs
392
+ text_node link_to(*args, **kwargs)
393
393
  end
394
394
  end
395
395
  end # IndexTableFor