1
0
Fork 0
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:
Rafael Mendonça França 2015-12-14 15:54:08 -02:00
parent f8058a6aeb
commit 3d4a423cdc

View file

@ -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