aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_controller/record_identifier.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/record_identifier.rb b/actionpack/lib/action_controller/record_identifier.rb
index 9c35c5b0c3..3f966b1b64 100644
--- a/actionpack/lib/action_controller/record_identifier.rb
+++ b/actionpack/lib/action_controller/record_identifier.rb
@@ -77,8 +77,8 @@ module ActionController
# make sure yourself that your dom ids are valid, in case you overwrite this method.
def record_key_for_dom_id(record)
return record.id unless record.respond_to?(:to_model)
- key = record.to_model.key
- key ? sanitize_dom_id(key.join('-')) : key
+ key = record.to_model.to_key
+ key ? sanitize_dom_id(key.join('_')) : key
end
# Replaces characters that are invalid in HTML DOM ids with valid ones.