2010-05-28 22 views
1
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不起作用。为什么?class ProfilePresenter <ActionView :: Base | url_for不起作用。为什么?

我作出这样

ProfilePresenter.new 
+2

如果你解决你自己的答案,这是最好写的解答在答案然后接受它。 – 2010-05-29 02:13:12

回答

1

一个新实例解决:我需要通过控制器实例时,我实例的ActionView :: Base的

相关问题