我正在使用private_pub向我的用户推送订阅客户端的通知。在我的 application.html.haml 我有:
...
= javascript_include_tag 'application'
= subscribe_to "/#{@user.access_token}/notifications"
...
subscribe_to 助手在开发中工作正常。部署到生产环境时,会记录以下错误:
ActionView::Template::Error (undefined method `subscribe_to' for #<#<Class:0x00000001f372e8>:0x00000001fded90>):
5: = stylesheet_link_tag 'application', :media => 'all'
6: = include_gon(:init => true)
7: = javascript_include_tag 'application'
8: = subscribe_to "/#{@user.access_token}/notifications"
9: = csrf_meta_tags
10:
11: %body
app/views/layouts/application.html.haml:8:in `_app_views_layouts_application_html_haml__1867651381877570337_14592040'
如何在我的生产环境中访问此辅助方法?