aboutsummaryrefslogtreecommitdiffstats
path: root/railties/guides/rails_guides/indexer.rb
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2009-02-24 12:29:25 +0000
committerPratik Naik <pratiknaik@gmail.com>2009-02-24 12:29:25 +0000
commit53cd102b39eb62567298430cbd94e40dd78d46a0 (patch)
tree3d8a087421f0d74da7a7c3878e3ad1dddbf23697 /railties/guides/rails_guides/indexer.rb
parente56b3e4c0b60b2b86f5ca9c5e5a0b22fa34d37ab (diff)
downloadrails-53cd102b39eb62567298430cbd94e40dd78d46a0.tar.gz
rails-53cd102b39eb62567298430cbd94e40dd78d46a0.tar.bz2
rails-53cd102b39eb62567298430cbd94e40dd78d46a0.zip
Merge with docrails
Diffstat (limited to 'railties/guides/rails_guides/indexer.rb')
-rw-r--r--railties/guides/rails_guides/indexer.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/railties/guides/rails_guides/indexer.rb b/railties/guides/rails_guides/indexer.rb
index 52809829e2..7cb254d0b0 100644
--- a/railties/guides/rails_guides/indexer.rb
+++ b/railties/guides/rails_guides/indexer.rb
@@ -29,13 +29,17 @@ module RailsGuides
return level_hash
elsif level == current_level
index = counters.join(".")
- bookmark = '#' + title.gsub(/[^a-z0-9\-_\+]+/i, '').underscore.dasherize
+ bookmark = '#' + title.gsub(/[^a-z0-9\-_]+/i, '').underscore.dasherize
raise "Parsing Fail" unless @result.sub!(matched, "h#{level}(#{bookmark}). #{index}#{title}")
+ key = {
+ :title => title,
+ :id => bookmark
+ }
# Recurse
counters << 1
- level_hash[title.strip] = process(s.post_match, current_level + 1, counters)
+ level_hash[key] = process(s.post_match, current_level + 1, counters)
counters.pop
# Increment the current level