AWRDwRv2 is pretty vague on the @body part of setting up a mailer. Here is my problem:>> p = Person.find(1)=> #<Person:0x45c944c>>> SiteMailer.request_admin_approval(p)NoMethodError: You have a nil object when you didn''t expect it! You might have expected an instance of Array. The error occurred while evaluating nil.[] from site_mailer.rb:10:in `request_admin_approval'' from (irb):2 ln def self.request_admin_approval(person) @subject = ''New User Notification'' 10 @body["person"] = person @recipients = person.email @from = ''server-6AQQTOP5xU+Z+DCkdF2Uwti2O/JbrIOy@public.gmane.org'' @sent_on = Time.now @headers = {} 15 end -- 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?hl=en -~----------~----~----~----~------~----~------~--~---
Taylor Strait <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> said:> > AWRDwRv2 is pretty vague on the @body part of setting up a mailer. Here > is my problem: > > >> p = Person.find(1) > => #<Person:0x45c944c> > > >> SiteMailer.request_admin_approval(p) > NoMethodError: You have a nil object when you didn''t expect it! > You might have expected an instance of Array. > The error occurred while evaluating nil.[]> from site_mailer.rb:10:in `request_admin_approval'' > from (irb):2 > > ln def self.request_admin_approval(person) > @subject = ''New User Notification'' > 10 @body["person"] = personbody = :person => person That should do what you are looking for. -- Mark Loeser email - mark AT halcy0n DOT com web - http://www.halcy0n.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?hl=en -~----------~----~----~----~------~----~------~--~---
> body = :person => person > > That should do what you are looking for. >Thanks, Mark. Where did that come from? There isn''t anything like it in AWDwRv2. -- 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?hl=en -~----------~----~----~----~------~----~------~--~---
Taylor Strait <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> said:> > > body = :person => person > > > > That should do what you are looking for. > > > > Thanks, Mark. Where did that come from? There isn''t anything like it > in AWDwRv2.http://api.rubyonrails.org has some nice examples on it. It currently seems to be down though. -- Mark Loeser email - mark AT halcy0n DOT com web - http://www.halcy0n.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?hl=en -~----------~----~----~----~------~----~------~--~---
This syntax doesn''t work for me:> body = :person => personBut this does: body :person => person The API docs conflict with AWDwRv2 and the mailer generator in the format. The API doesn''t use ''='' but the generator and AWD do. I assume the API docs are out of date, but then @body = does NOT work. Bummer. -- 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?hl=en -~----------~----~----~----~------~----~------~--~---
Taylor Strait <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> said:> > This syntax doesn''t work for me: > > > body = :person => person > > But this does: > > body :person => personYup, oops. I meant to remove that =. I always go by whatever is on api.rubyonrails.org. -- Mark Loeser email - mark AT halcy0n DOT com web - http://www.halcy0n.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?hl=en -~----------~----~----~----~------~----~------~--~---