简体   繁体   English

类ProfilePresenter <ActionView :: Base | url_for不起作用。 为什么?

[英]class ProfilePresenter < ActionView::Base | url_for doesn't work. why?

class ProfilePresenter < ActionView::Base 
 def initialize
  super
  url_for   # i got: You have a nil object when you didn't expect it!
            #        The error occurred while evaluating nil.url_for
 end
end

url_for doesn't work. url_for不起作用。 why? 为什么?

i make a new instance like this 我做了一个这样的新实例

ProfilePresenter.new

求助:我需要在实例ActionView :: Base时传递控制器实例

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM