ActionView::TemplateError (undefined method `url_for'

Wow, this is driving me crazy. I keep getting this error:

ActionView::TemplateError (undefined method `url_for’ for
#Notifier:0x40755260) on line #0 of
app/views/notifier/link_added.rhtml:

Absolutely nowhere in that template (or the ActionMailer) is ‘url_for’,
nor any other methods. The
template just outputs variables. Notifier (an ActionMailer) just assigns
the vars. In my
controller I have:

def create

Notifier::deliver_link_added(@site, @link,
url_for({:controller=>‘link’, :action=>‘edit’,
:id=>@link.id}))

redirect_to({:controller => ‘link’, :action => ‘added’, :id =>
@link.id})

end

Furthering my insanity, I get one of three different results:

  1. Application error with the aforementioned error in the log.
  2. Link gets created, but Notifier’s link_added template gets displayed
    for link#added rather than
    view/link/added.rhtml
  3. Everything works fine!

Restarting SCGI usually lets #3 or #2 happen again, but adding
additional links thereafter usually
results in #1.

csn


Yahoo! DSL ? Something to write home about.
Just $16.99/mo. or less.
dsl.yahoo.com