diff options
Diffstat (limited to 'guides/rails_guides')
-rw-r--r-- | guides/rails_guides/generator.rb | 2 | ||||
-rw-r--r-- | guides/rails_guides/markdown/renderer.rb | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/guides/rails_guides/generator.rb b/guides/rails_guides/generator.rb index c3b77aa7bb..7d4a15962c 100644 --- a/guides/rails_guides/generator.rb +++ b/guides/rails_guides/generator.rb @@ -164,7 +164,7 @@ module RailsGuides # Generate the special pages like the home. # Passing a template handler in the template name is deprecated. So pass the file name without the extension. - result = view.render(layout: layout, formats: [$1], file: $`) + result = view.render(layout: layout, formats: [$1.to_sym], file: $`) else body = File.read("#{@source_dir}/#{guide}") result = RailsGuides::Markdown.new( diff --git a/guides/rails_guides/markdown/renderer.rb b/guides/rails_guides/markdown/renderer.rb index f186ac526f..7f14c28bbc 100644 --- a/guides/rails_guides/markdown/renderer.rb +++ b/guides/rails_guides/markdown/renderer.rb @@ -16,7 +16,7 @@ HTML end def link(url, title, content) - if url.start_with?("http://api.rubyonrails.org") + if %r{https?://api\.rubyonrails\.org}.match?(url) %(<a href="#{api_link(url)}">#{content}</a>) elsif title %(<a href="#{url}" title="#{title}">#{content}</a>) @@ -115,7 +115,7 @@ HTML end def api_link(url) - if %r{http://api\.rubyonrails\.org/v\d+\.}.match?(url) + if %r{https?://api\.rubyonrails\.org/v\d+\.}.match?(url) url elsif edge url.sub("api", "edgeapi") |