Ruby on rails 4 单元格4中的应用程序帮助程序rails 4

Ruby on rails 4 单元格4中的应用程序帮助程序rails 4,ruby-on-rails-4,rails-cells,Ruby On Rails 4,Rails Cells,我使用单元格4在rails 4中呈现登录表单, 我得到以下错误: 'undefined local variable or method `current_user' for <PopupLoginCell:0xbbd32e74>' 在单元类中,必须包含设计帮助程序: class PopupLoginCell < Cell::ViewModel include Devise::Controllers::Helpers helper_method :current_us

我使用单元格4在rails 4中呈现登录表单, 我得到以下错误:

'undefined local variable or method `current_user' for <PopupLoginCell:0xbbd32e74>'

在单元类中,必须包含设计帮助程序:

class PopupLoginCell < Cell::ViewModel
  include Devise::Controllers::Helpers
  helper_method :current_user

  # Your class code
end
class-PopupLoginCell

我希望这会有所帮助。

您可以选择将当前用户传递给手机

#haml/slim
= cell(PopupLoginCell, my_model, current_user: current_user)
#erb
<%= cell(PopupLoginCell, my_model, current_user: current_user) %>
#haml/slim
=单元格(PopupLoginCell,我的\模型,当前\用户:当前\用户)
#雇员再培训局

尝试使用
包含ApplicationController
代替。嗨,Pavan,错误显示=>“错误的参数类型类(预期模块)”@khavq,你解决过这个问题吗?此外,您可能希望使用rails单元格标记来标记此问题,以获得更多眼球。
#haml/slim
= cell(PopupLoginCell, my_model, current_user: current_user)
#erb
<%= cell(PopupLoginCell, my_model, current_user: current_user) %>