aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Moss <maclover7@users.noreply.github.com>2016-02-07 21:24:10 -0500
committerJon Moss <maclover7@users.noreply.github.com>2016-02-07 21:24:10 -0500
commit2b18bd5ffa05782a13d5f9e6157428bb44554360 (patch)
tree486eb49c1f177fada0201861a85a5f5d43eef5e1
parent8af52c06558d2b4fde8ec4070631fe94bf5486b9 (diff)
parent0ec48ab0cbc4ebb739101fffcbee98e7347aefda (diff)
downloadrails-2b18bd5ffa05782a13d5f9e6157428bb44554360.tar.gz
rails-2b18bd5ffa05782a13d5f9e6157428bb44554360.tar.bz2
rails-2b18bd5ffa05782a13d5f9e6157428bb44554360.zip
Merge pull request #23554 from romaimperator/update_action_cable_config_example
config examples for ActionCable now use Rails.application.config.action_cable
-rw-r--r--actioncable/README.md6
1 files changed, 3 insertions, 3 deletions
diff --git a/actioncable/README.md b/actioncable/README.md
index 6e74551483..3316f88a23 100644
--- a/actioncable/README.md
+++ b/actioncable/README.md
@@ -324,7 +324,7 @@ Rails.application.paths.add "config/cable", with: "somewhere/else/cable.yml"
Action Cable will only accept requests from specified origins, which are passed to the server config as an array. The origins can be instances of strings or regular expressions, against which a check for match will be performed.
```ruby
-ActionCable.server.config.allowed_request_origins = ['http://rubyonrails.com', /http:\/\/ruby.*/]
+Rails.application.config.action_cable.allowed_request_origins = ['http://rubyonrails.com', /http:\/\/ruby.*/]
```
When running in the development environment, this defaults to "http://localhost:3000".
@@ -332,7 +332,7 @@ When running in the development environment, this defaults to "http://localhost:
To disable and allow requests from any origin:
```ruby
-ActionCable.server.config.disable_request_forgery_protection = true
+Rails.application.config.action_cable.disable_request_forgery_protection = true
```
### Consumer Configuration
@@ -374,7 +374,7 @@ App.cable = ActionCable.createConsumer()
The other common option to configure is the log tags applied to the per-connection logger. Here's close to what we're using in Basecamp:
```ruby
-ActionCable.server.config.log_tags = [
+Rails.application.config.action_cable.log_tags = [
-> request { request.env['bc.account_id'] || "no-account" },
:action_cable,
-> request { request.uuid }