mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
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.
This commit is contained in:
parent
f8058a6aeb
commit
3d4a423cdc
1 changed files with 4 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue