mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
[ci skip] Fix guides to link to edgeapi if on EDGE env
This commit is contained in:
parent
43866b2ca3
commit
75aeac9fdf
1 changed files with 2 additions and 2 deletions
|
@ -16,7 +16,7 @@ HTML
|
||||||
end
|
end
|
||||||
|
|
||||||
def link(url, title, content)
|
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>)
|
%(<a href="#{api_link(url)}">#{content}</a>)
|
||||||
elsif title
|
elsif title
|
||||||
%(<a href="#{url}" title="#{title}">#{content}</a>)
|
%(<a href="#{url}" title="#{title}">#{content}</a>)
|
||||||
|
@ -115,7 +115,7 @@ HTML
|
||||||
end
|
end
|
||||||
|
|
||||||
def api_link(url)
|
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
|
url
|
||||||
elsif edge
|
elsif edge
|
||||||
url.sub("api", "edgeapi")
|
url.sub("api", "edgeapi")
|
||||||
|
|
Loading…
Reference in a new issue