It seems like you can't use the url_for helper in the initialize method of a controller:
class TestController < ApplicationController def initialize @somevar = url_for ( :action => 'index' ) #<=== This errors out for some reason end
def some_method @somevar = url_for ( :action => 'index' ) #<=== but this works end end
Any idea why this is happening? Is there a known work around?
Thanks
Rafael