views:

16

answers:

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 doesn't work. why?

i make a new instance like this

ProfilePresenter.new
+1  A: 

SOLVED: i need to pass the controller instance when i instance the ActionView::Base

Totty