Skip to content

Commit a2f0343

Browse files
committed
update example to specify the Action Cable mount path [ci skip]
Follow up to 8b69f1e
1 parent 53ab1ee commit a2f0343

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

actioncable/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -412,12 +412,12 @@ The above will start a cable server on port 28080.
412412

413413
### In app
414414

415-
If you are using a server that supports the [Rack socket hijacking API](http://www.rubydoc.info/github/rack/rack/file/SPEC#Hijacking), Action Cable can run alongside your Rails application. For example, to listen for WebSocket requests on `/cable`, mount the server at that path:
415+
If you are using a server that supports the [Rack socket hijacking API](http://www.rubydoc.info/github/rack/rack/file/SPEC#Hijacking), Action Cable can run alongside your Rails application. For example, to listen for WebSocket requests on `/websocket`, specify that path to `config.action_cable.mount_path`:
416416

417417
```ruby
418-
# config/routes.rb
419-
Example::Application.routes.draw do
420-
mount ActionCable.server => '/cable'
418+
# config/application.rb
419+
class Application < Rails::Application
420+
config.action_cable.mount_path = '/websocket'
421421
end
422422
```
423423

guides/source/action_cable_overview.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -549,12 +549,13 @@ You can change that in `config/database.yml` through the `pool` attribute.
549549
### In App
550550

551551
Action Cable can run alongside your Rails application. For example, to
552-
listen for WebSocket requests on `/websocket`, mount the server at that path:
552+
listen for WebSocket requests on `/websocket`, specify that path to
553+
`config.action_cable.mount_path`:
553554

554555
```ruby
555-
# config/routes.rb
556-
Example::Application.routes.draw do
557-
mount ActionCable.server => '/cable'
556+
# config/application.rb
557+
class Application < Rails::Application
558+
config.action_cable.mount_path = '/websocket'
558559
end
559560
```
560561

0 commit comments

Comments
 (0)