Skip to content

Commit b425a86

Browse files
Add small Action Cable documentation fixes
* Fix typos/grammar errors * Make capitalization/naming consistent
1 parent ecf6dc3 commit b425a86

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

actioncable/README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -339,21 +339,21 @@ Rails.application.config.action_cable.disable_request_forgery_protection = true
339339

340340
### Consumer Configuration
341341

342-
Once you have decided how to run your cable server (see below), you must provide the server url (or path) to your client-side setup.
342+
Once you have decided how to run your cable server (see below), you must provide the server URL (or path) to your client-side setup.
343343
There are two ways you can do this.
344344

345345
The first is to simply pass it in when creating your consumer. For a standalone server,
346346
this would be something like: `App.cable = ActionCable.createConsumer("ws://example.com:28080")`, and for an in-app server,
347347
something like: `App.cable = ActionCable.createConsumer("/cable")`.
348348

349-
The second option is to pass the server url through the `action_cable_meta_tag` in your layout.
350-
This uses a url or path typically set via `config.action_cable.url` in the environment configuration files, or defaults to "/cable".
349+
The second option is to pass the server URL through the `action_cable_meta_tag` in your layout.
350+
This uses a URL or path typically set via `config.action_cable.url` in the environment configuration files, or defaults to "/cable".
351351

352-
This method is especially useful if your WebSocket url might change between environments. If you host your production server via https, you will need to use the wss scheme
352+
This method is especially useful if your WebSocket URL might change between environments. If you host your production server via https, you will need to use the wss scheme
353353
for your Action Cable server, but development might remain http and use the ws scheme. You might use localhost in development and your
354354
domain in production.
355355

356-
In any case, to vary the WebSocket url between environments, add the following configuration to each environment:
356+
In any case, to vary the WebSocket URL between environments, add the following configuration to each environment:
357357

358358
```ruby
359359
config.action_cable.url = "ws://example.com:28080"

actioncable/lib/action_cable/channel/base.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ def perform_action(data)
166166
end
167167
end
168168

169-
# Called by the cable connection when its cut, so the channel has a chance to cleanup with callbacks.
169+
# Called by the cable connection when it's cut, so the channel has a chance to cleanup with callbacks.
170170
# This method is not intended to be called directly by the user. Instead, overwrite the #unsubscribed callback.
171171
def unsubscribe_from_channel # :nodoc:
172172
run_callbacks :unsubscribe do

actioncable/lib/action_cable/channel/streams.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module ActionCable
22
module Channel
3-
# Streams allow channels to route broadcastings to the subscriber. A broadcasting is, as discussed elsewhere, a pub/sub queue where any data
3+
# Streams allow channels to route broadcastings to the subscriber. A broadcasting is, as discussed elsewhere, a pubsub queue where any data
44
# placed into it is automatically sent to the clients that are connected at that time. It's purely an online queue, though. If you're not
55
# streaming a broadcasting at the very moment it sends out an update, you will not get that update, if you connect after it has been sent.
66
#

actioncable/lib/action_cable/helpers/action_cable_helper.rb

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
module ActionCable
22
module Helpers
33
module ActionCableHelper
4-
# Returns an "action-cable-url" meta tag with the value of the url specified in your
5-
# configuration. Ensure this is above your javascript tag:
4+
# Returns an "action-cable-url" meta tag with the value of the URL specified in your
5+
# configuration. Ensure this is above your JavaScript tag:
66
#
77
# <head>
88
# <%= action_cable_meta_tag %>
99
# <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
1010
# </head>
1111
#
12-
# This is then used by Action Cable to determine the url of your WebSocket server.
12+
# This is then used by Action Cable to determine the URL of your WebSocket server.
1313
# Your CoffeeScript can then connect to the server without needing to specify the
14-
# url directly:
14+
# URL directly:
1515
#
1616
# #= require cable
1717
# @App = {}
1818
# App.cable = Cable.createConsumer()
1919
#
20-
# Make sure to specify the correct server location in each of your environments
21-
# config file:
20+
# Make sure to specify the correct server location in each of your environment
21+
# config files:
2222
#
2323
# config.action_cable.mount_path = "/cable123"
2424
# <%= action_cable_meta_tag %> would render:

guides/source/configuring.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -622,8 +622,8 @@ There are a few configuration options available in Active Support:
622622
if you are running Action Cable servers that are separated from your
623623
main application.
624624
* `config.action_cable.mount_path` accepts a string for where to mount Action
625-
Cable, as apart of the main server process. Defaults to `/cable`.
626-
You can set this as nil to not mount Action Cable as apart of your
625+
Cable, as part of the main server process. Defaults to `/cable`.
626+
You can set this as nil to not mount Action Cable as part of your
627627
normal Rails server.
628628

629629
### Configuring a Database

0 commit comments

Comments
 (0)