2010-05-28 49 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的