Forum: Ruby on Rails ActionView::TemplateError (undefined method `url_for'

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
cool_screen_name90001 (Guest)
on 2005-12-05 06:28
(Received via mailing list)
Wow, this is driving me crazy. I keep getting this error:

ActionView::TemplateError (undefined method `url_for' for
#<Notifier:0x40755260>) on line #0 of

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',

  redirect_to({:controller => 'link', :action => 'added', :id =>})

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
3. Everything works fine!

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


Yahoo! DSL ? Something to write home about.
Just $16.99/mo. or less.
This topic is locked and can not be replied to.