1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #24557 from y-yagi/update_example_to_specify_ac_mount_path

update example to specify the Action Cable mount path [ci skip]
This commit is contained in:
Vipul A M 2016-04-15 16:00:42 +05:30
commit 8ad9670abb
2 changed files with 9 additions and 8 deletions

View file

@ -412,12 +412,12 @@ The above will start a cable server on port 28080.
### In app
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:
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`:
```ruby
# config/routes.rb
Example::Application.routes.draw do
mount ActionCable.server => '/cable'
# config/application.rb
class Application < Rails::Application
config.action_cable.mount_path = '/websocket'
end
```

View file

@ -549,12 +549,13 @@ You can change that in `config/database.yml` through the `pool` attribute.
### In App
Action Cable can run alongside your Rails application. For example, to
listen for WebSocket requests on `/websocket`, mount the server at that path:
listen for WebSocket requests on `/websocket`, specify that path to
`config.action_cable.mount_path`:
```ruby
# config/routes.rb
Example::Application.routes.draw do
mount ActionCable.server => '/cable'
# config/application.rb
class Application < Rails::Application
config.action_cable.mount_path = '/websocket'
end
```