diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-12-14 15:54:08 -0200 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-12-14 15:54:08 -0200 |
commit | 3d4a423cdc6f365bb303b2827cc4890de8b1d28d (patch) | |
tree | f34a24ad9416943265e2a43e0578cb085239ad5c /actioncable | |
parent | f8058a6aebb913dd90b5d5c797895e531e9356d4 (diff) | |
download | rails-3d4a423cdc6f365bb303b2827cc4890de8b1d28d.tar.gz rails-3d4a423cdc6f365bb303b2827cc4890de8b1d28d.tar.bz2 rails-3d4a423cdc6f365bb303b2827cc4890de8b1d28d.zip |
Hook in ActionView::Base, not in ApplicationController
The application can have more than one ApplicationController and we
want Action Cable helpers in all controllers and their views so we
should hook in the same place that others helpers.
Diffstat (limited to 'actioncable')
-rw-r--r-- | actioncable/lib/action_cable/engine.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/actioncable/lib/action_cable/engine.rb b/actioncable/lib/action_cable/engine.rb index 2cd13285e7..071dcd73e4 100644 --- a/actioncable/lib/action_cable/engine.rb +++ b/actioncable/lib/action_cable/engine.rb @@ -7,8 +7,10 @@ module ActionCable class Engine < ::Rails::Engine config.action_cable = ActiveSupport::OrderedOptions.new - config.to_prepare do - ApplicationController.helper ActionCable::Helpers::ActionCableHelper + initializer "action_cable.helpers" do + ActiveSupport.on_load(:action_view) do + include ActionCable::Helpers::ActionCableHelper + end end initializer "action_cable.logger" do |