Ruby on Rails' “控制器.助手”缺失了,如何解决?
如果一个项目运行的是Rails 2.2.2,并且它使用controller.helper
并且未定义helper
,那么如何解决? (这是针对 Facebooker2 gem http://github.com/mmangino/facebooker2)
详细信息:
显示错误:
=> Rails 2.2.2 application starting on http://0.0.0.0:3000
Exiting
/Library/
Ruby/
Gems/1.8/gems/facebooker2-0.0.5/lib/facebooker2/rails/controller.rb:8:
in `included': undefined method `helper' for Object:Class (NoMethodError)
代码是:错误行是
controller.helper Facebooker2::Rails::Helpers
以下代码中的第8行:
module Facebooker2
module Rails
module Controller
def self.included(controller)
controller.helper Facebooker2::Rails::Helpers
controller.helper_method :current_facebook_user
controller.helper_method :current_facebook_client
controller.helper_method :facebook_params
end
If a project is running Rails 2.2.2, and it uses controller.helper
and the helper
is not defined, then how can it be solved? (this is for the Facebooker2 gem http://github.com/mmangino/facebooker2)
details:
error shown:
=> Rails 2.2.2 application starting on http://0.0.0.0:3000
Exiting
/Library/
Ruby/
Gems/1.8/gems/facebooker2-0.0.5/lib/facebooker2/rails/controller.rb:8:
in `included': undefined method `helper' for Object:Class (NoMethodError)
The code is: error line is line 8:
controller.helper Facebooker2::Rails::Helpers
in the following code:
module Facebooker2
module Rails
module Controller
def self.included(controller)
controller.helper Facebooker2::Rails::Helpers
controller.helper_method :current_facebook_user
controller.helper_method :current_facebook_client
controller.helper_method :facebook_params
end
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论