Skip to content

Commit 4dfbd59

Browse files
Copilotsenid231
andcommitted
Add clarifying comment to table_cell_selector transformation
Agent-Logs-Url: https://github.com/activeadmin-plugins/capybara_active_admin/sessions/7498bf2c-1012-4f45-a573-e5f8a7124f08 Co-authored-by: senid231 <8393857+senid231@users.noreply.github.com>
1 parent 1f6dc9b commit 4dfbd59

File tree

1 file changed

+1
-0
lines changed
  • lib/capybara/active_admin/selectors

1 file changed

+1
-0
lines changed

lib/capybara/active_admin/selectors/table.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ def table_header_selector
3232
def table_cell_selector(column = nil)
3333
return 'td.col' if column.nil?
3434

35+
# Downcase, strip non-alphanumeric chars (e.g. '/'), convert spaces to '_', deduplicate '_'
3536
column = column.to_s.downcase.gsub(/[^a-z0-9\s]/, '').gsub(/\s+/, '_').squeeze('_')
3637
"td.col.col-#{column}"
3738
end

0 commit comments

Comments
 (0)