Thanks!  I can now set the template_root with
ActionMailer::Base.template_root=.  However, it still is not finding
my template.  It looks like an Array is not getting initialized.

I not using rails framework, since this is not a rails app.  So, I did
not do the script/generate mailer Mailer to generate my Mailer class.
I just manually created it in my app's framework.  Is there something
in rails or the generate script that is not getting set because I'm
not in rails.  Do I need to create a controller class?  I don't
remember having one with my limited rails development work a few years
ago.  I thought it was decoupled from ActionController.

Here is my class.  When I call Mailer.deliver_results(team, week)
looping a teams collections, I get the new error.
require 'action_controller'

class Mailer < ActionMailer::Base
   def results(team, week)
    recipients    team.email
    from          "commissio...@ffl.net"
    subject       "TPL: #{week.description} Results"
    body          :team => team, :week => week
  end
end


/home/gditric/sandbox/ffl/vendor/gems/1.9.1/gems/actionmailer-2.3.4/
lib/action_mailer/base.rb:582:in `candidate_for_layout?': undefined
method `find_template' for []:Array (NoMethodError)
        from /home/gditric/sandbox/ffl/vendor/gems/1.9.1/gems/
actionpack-2.3.4/lib/action_controller/layout.rb:240:in `pick_layout'
        from /home/gditric/sandbox/ffl/vendor/gems/1.9.1/gems/
actionmailer-2.3.4/lib/action_mailer/base.rb:566:in `render'
        from /home/gditric/sandbox/ffl/vendor/gems/1.9.1/gems/
actionmailer-2.3.4/lib/action_mailer/base.rb:553:in `render_message'
        from /home/gditric/sandbox/ffl/vendor/gems/1.9.1/gems/
actionmailer-2.3.4/lib/action_mailer/base.rb:493:in `create!'
        from /home/gditric/sandbox/ffl/vendor/gems/1.9.1/gems/
actionmailer-2.3.4/lib/action_mailer/base.rb:452:in `initialize'
        from /home/gditric/sandbox/ffl/vendor/gems/1.9.1/gems/
actionmailer-2.3.4/lib/action_mailer/base.rb:395:in `new'
        from /home/gditric/sandbox/ffl/vendor/gems/1.9.1/gems/
actionmailer-2.3.4/lib/action_mailer/base.rb:395:in `method_missing'
        from ./ffl.rb:104:in `block in <main>'
        from ./ffl.rb:103:in `each'
        from ./ffl.rb:103:in `<main>'



Thanks again.  I'm getting further...and still experimenting.  ;)


GregD




On Oct 6, 9:21 pm, Yehuda Katz <wyc...@gmail.com> wrote:
> We're in the process of reworking AM to work with the new
> AbstractController. One design goal is making the path to standalone use
> more clear. For your case, try require "action_controller" before trying to
> do any AM stuff :)
> -- Yehuda
>
> 2009/10/6 GregD <gditr...@fuse.net>
>
>
>
>
>
>
>
> > Hi everyone,
>
> > Has anybody used ActionMailer outside rails?  I have googled and found
> > some things, but I can not seem to get it to work for a stand-alone
> > app.
>
> > The problem is setting the template_root.  If I dont' set it,
> > ActionMailer can not find my mail templates.  If I try and set it, I
> > get an uninitialized constant ActionView::Base::ActionController when
> > I:
>
> > ActionMailer::Base.template_root = 'some-path'
>
> > I'm putting action_mailer, action_pack, rack, and active_support in a
> > vendor subdir of the app, so I can ship it with the app and adding to
> > the LOAD_PATH at the beggining og the app.
>
> > Appreciate any help here!!!!!!
>
> > Here is the full error:
>
> > /home/gditric/sandbox/ffl/vendor/activesupport-2.3.4/lib/
> > active_support/dependencies.rb:105:in `rescue in const_missing':
> > uninitialized constant ActionView::Base::ActionController (NameError)
> >        from /home/gditric/sandbox/ffl/vendor/activesupport-2.3.4/lib/
> > active_support/dependencies.rb:94:in `const_missing'
> >        from /home/gditric/sandbox/ffl/vendor/actionpack-2.3.4/lib/
> > action_view/base.rb:191:in `cache_template_loading?'
> >        from /home/gditric/sandbox/ffl/vendor/actionpack-2.3.4/lib/
> > action_view/paths.rb:5:in `type_cast'
> >        from /home/gditric/sandbox/ffl/vendor/actionpack-2.3.4/lib/
> > action_view/paths.rb:16:in `block in initialize'
> >        from /home/gditric/sandbox/ffl/vendor/actionpack-2.3.4/lib/
> > action_view/paths.rb:16:in `map!'
> >        from /home/gditric/sandbox/ffl/vendor/actionpack-2.3.4/lib/
> > action_view/paths.rb:16:in `initialize'
> >        from /home/gditric/sandbox/ffl/vendor/actionpack-2.3.4/lib/
> > action_view/base.rb:205:in `new'
> >        from /home/gditric/sandbox/ffl/vendor/actionpack-2.3.4/lib/
> > action_view/base.rb:205:in `process_view_paths'
> >        from /home/gditric/sandbox/ffl/vendor/actionmailer-2.3.4/lib/
> > action_mailer/base.rb:437:in `template_root='
> >        from ./ffl.rb:66:in `<main>'
>
> --
> Yehuda Katz
> Developer | Engine Yard
> (ph) 718.877.1325- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To post to this group, send email to rubyonrails-core@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-core+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to