diff options
-rw-r--r-- | guides/rails_guides/markdown/renderer.rb | 4 | ||||
-rw-r--r-- | guides/source/action_cable_overview.md | 6 |
2 files changed, 5 insertions, 5 deletions
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") diff --git a/guides/source/action_cable_overview.md b/guides/source/action_cable_overview.md index 7bf6a73797..f1e2a0081f 100644 --- a/guides/source/action_cable_overview.md +++ b/guides/source/action_cable_overview.md @@ -190,15 +190,15 @@ This will ready a consumer that'll connect against `/cable` on your server by de The connection won't be established until you've also specified at least one subscription you're interested in having. -The consumer can optionally take an argument that specifies the url to connect to. This +The consumer can optionally take an argument that specifies the URL to connect to. This can be a string, or a function that returns a string that will be called when the WebSocket is opened. ```js -// Specify a different url to connect to +// Specify a different URL to connect to createConsumer('https://ws.example.com/cable') -// Use a function to dynamically generate the url +// Use a function to dynamically generate the URL createConsumer(getWebSocketURL) function getWebSocketURL { |