I am trying to use one of my ActionMailer models. What I''m trying to do is deliver an email from within another model. I keep getting this error: #<ActionView::ActionViewError: No rhtml, rxml, rjs or delegate template found for testaroo> I have checked the spelling about 20 times, check the file locations, etc. When I run the method from script/runner it works fine. I get the email. Here is what I''m running: script/runner ''Notifier.deliver_testaroo'' Here is the method: def testaroo(sent_at = Time.now) subject "Testing" recipients ''myemail-IEbV4ISQ1ORWk0Htik3J/w@public.gmane.org'' from "fdsdsf-BtPYpacvOE/WXxRugSxzZg@public.gmane.org" sent_on sent_at end Why does it work in script/runner but not in another model? Thanks for your help. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Ben Johnson wrote:> I am trying to use one of my ActionMailer models. What I''m trying to do > is deliver an email from within another model. > > I keep getting this error: > > #<ActionView::ActionViewError: No rhtml, rxml, rjs or delegate template > found for testaroo> > > I have checked the spelling about 20 times, check the file locations, > etc. When I run the method from script/runner it works fine. I get the > email. Here is what I''m running: > > script/runner ''Notifier.deliver_testaroo'' > > Here is the method: > > def testaroo(sent_at = Time.now) > subject "Testing" > recipients ''myemail-IEbV4ISQ1ORWk0Htik3J/w@public.gmane.org'' > from "fdsdsf-BtPYpacvOE/WXxRugSxzZg@public.gmane.org" > sent_on sent_at > end > > Why does it work in script/runner but not in another model? > > Thanks for your help.Does it work from a controller (instead of a model)? Michael -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Yes. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Ben Johnson wrote:> Yes.Should models be calling other models? It seems the controller should interact with the model. I''ll probably get blasted by everyone who reads this but it seems wrong to have a model call a model. Michael -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Michael Modica wrote:> Ben Johnson wrote: >> Yes. > > Should models be calling other models? It seems the controller should > interact with the model. > > I''ll probably get blasted by everyone who reads this but it seems wrong > to have a model call a model. > > MichaelNot to send emails. What if I want to send an email on a model action? Maybe if you modify a user or something. I don''t know, but I don''t see why that''s wrong. This is probably the strangest issue I''ve had with rails. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Ben Johnson wrote:> Michael Modica wrote: >> Ben Johnson wrote: >>> Yes. >> >> Should models be calling other models? It seems the controller should >> interact with the model. >> >> I''ll probably get blasted by everyone who reads this but it seems wrong >> to have a model call a model. >> >> Michael > > Not to send emails. What if I want to send an email on a model action? > Maybe if you modify a user or something. I don''t know, but I don''t see > why that''s wrong. > > This is probably the strangest issue I''ve had with rails.Ben, Why don''t you just have your model call a function on its own controller and then have that function send the email? Maybe that will work... Michael -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---