Skip to content


Removed the sanitize_dom_id method #6017

merged 1 commit into from

4 participants


The HTML5 spec let's us use anything as the ID element, so we don't need to sanitize the dom id's for valid names anymore(Not that it did anything in the first place)

This was discussed in issue #6015

Ruby on Rails member

@jeremy I think we can merge this one.

Ruby on Rails member


@jeremy jeremy merged commit 7bb7f0c into rails:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 27, 2012
  1. @larzconwell

    Removed the sanitize_dom_id method because HTML5 doctype let's us use…

    larzconwell committed
    … anything except nothing and whitespace for id's
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 6 deletions.
  1. +1 −6 actionpack/lib/action_controller/record_identifier.rb
7 actionpack/lib/action_controller/record_identifier.rb
@@ -75,12 +75,7 @@ def dom_id(record, prefix = nil)
def record_key_for_dom_id(record)
record = record.to_model if record.respond_to?(:to_model)
key = record.to_key
- key ? sanitize_dom_id(key.join('_')) : key
- end
- # Replaces characters that are invalid in HTML DOM ids with valid ones.
- def sanitize_dom_id(candidate_id)
- candidate_id # TODO implement conversion to valid DOM id values
+ key ? key.join('_') : key
Something went wrong with that request. Please try again.