提交 a2f03433 编写于 作者: Y yuuji.yaginuma

update example to specify the Action Cable mount path [ci skip]

Follow up to 8b69f1ee
上级 53ab1ee5
...@@ -412,12 +412,12 @@ The above will start a cable server on port 28080. ...@@ -412,12 +412,12 @@ The above will start a cable server on port 28080.
### In app ### 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 ```ruby
# config/routes.rb # config/application.rb
Example::Application.routes.draw do class Application < Rails::Application
mount ActionCable.server => '/cable' config.action_cable.mount_path = '/websocket'
end end
``` ```
......
...@@ -549,12 +549,13 @@ You can change that in `config/database.yml` through the `pool` attribute. ...@@ -549,12 +549,13 @@ You can change that in `config/database.yml` through the `pool` attribute.
### In App ### In App
Action Cable can run alongside your Rails application. For example, to 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 ```ruby
# config/routes.rb # config/application.rb
Example::Application.routes.draw do class Application < Rails::Application
mount ActionCable.server => '/cable' config.action_cable.mount_path = '/websocket'
end end
``` ```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册