aboutsummaryrefslogtreecommitdiffstats
path: root/guides
diff options
context:
space:
mode:
authorPrem Sichanugrist <s@sikachu.com>2012-08-31 18:00:22 -0400
committerPrem Sichanugrist <s@sikac.hu>2012-09-17 15:54:21 -0400
commit848d13a8aafccae1ae222ae4da20a35bf0bb6df3 (patch)
tree8a01824e0ff9d2683da3788cbcc2be306081f612 /guides
parentefa7717b7ab71f026df4e464046519e973c31f9a (diff)
downloadrails-848d13a8aafccae1ae222ae4da20a35bf0bb6df3.tar.gz
rails-848d13a8aafccae1ae222ae4da20a35bf0bb6df3.tar.bz2
rails-848d13a8aafccae1ae222ae4da20a35bf0bb6df3.zip
Reuse parent's id if it's already exists
Diffstat (limited to 'guides')
-rw-r--r--guides/rails_guides/markdown.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/guides/rails_guides/markdown.rb b/guides/rails_guides/markdown.rb
index 12eabcbcc8..6ad42769bc 100644
--- a/guides/rails_guides/markdown.rb
+++ b/guides/rails_guides/markdown.rb
@@ -23,7 +23,7 @@ module RailsGuides
private
def dom_id(nodes)
- nodes.map{ |node| node.text.downcase.gsub(/[^a-z0-9]+/, '-') }.join('-')
+ nodes.map{ |node| node[:id] ? node[:id] : node.text.downcase.gsub(/[^a-z0-9]+/, '-') }.join('-')
end
def engine