lib/active_admin/views/components/attributes_table.rb in activeadmin-1.4.3 vs lib/active_admin/views/components/attributes_table.rb in activeadmin-2.0.0.rc1

- old
+ new

@@ -5,29 +5,29 @@ builder_method :attributes_table_for def build(obj, *attrs) @collection = Array.wrap(obj) @resource_class = @collection.first.class - options = { } + options = {} options[:for] = @collection.first if single_record? super(options) @table = table build_colgroups rows(*attrs) end def rows(*attrs) - attrs.each {|attr| row(attr) } + attrs.each { |attr| row(attr) } end def row(*args, &block) title = args[0] options = args.extract_options! classes = [:row] if options[:class] classes << options[:class] elsif title.present? - classes << "row-#{ActiveAdmin::Dependency.rails.parameterize(title.to_s)}" + classes << "row-#{title.to_s.parameterize(separator: "_")}" end options[:class] = classes.join(' ') @table << tr(options) do th do