Michael J. I. Jackson
2009-Feb-13 22:10 UTC
Undefined method ''parameters'' on controller.request
I''m getting a NoMethodError using Rails 2.1.0 when trying to send an email using ActionMailer. The error is being thrown from the template_format method in ActionView''s base.rb file. Apparently the controller.request object is an instance of DummyClass (according to the exception trace) instead of ActionController::Request, and therefore does not have any useful methods associated with it. Right now I''m thinking that because the ActionMailer doesn''t actually represent a separate request per se, that the request object is not being created correctly. Thus, when it goes to create the email using the template, it doesn''t really know what format to use. Just a hunch. I''m kind of a Rails newb, so any help with this issue would be greatly appreciated. Just let me know if you need to know any other information. Michael --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Julian Leviston
2009-Feb-14 15:27 UTC
Re: Undefined method ''parameters'' on controller.request
Actionmailer is a bit different because the mail has it''s own view which has no controller. You''d have to pass the controller in through the message to the mail when you''re delivering or building it. Blog: http://random8.zenunit.com/ Learn rails: http://sensei.zenunit.com/ On 14/02/2009, at 9:10 AM, "Michael J. I. Jackson" <mjijackson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > I''m getting a NoMethodError using Rails 2.1.0 when trying to send an > email using ActionMailer. The error is being thrown from the > template_format method in ActionView''s base.rb file. Apparently the > controller.request object is an instance of DummyClass (according to > the exception trace) instead of ActionController::Request, and > therefore does not have any useful methods associated with it. > > Right now I''m thinking that because the ActionMailer doesn''t actually > represent a separate request per se, that the request object is not > being created correctly. Thus, when it goes to create the email using > the template, it doesn''t really know what format to use. Just a hunch. > > I''m kind of a Rails newb, so any help with this issue would be greatly > appreciated. Just let me know if you need to know any other > information. > > Michael > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Michael J. I. Jackson
2009-Feb-15 06:05 UTC
Re: Undefined method ''parameters'' on controller.request
How do I pass the controller through so that a method like template_format will pick it up and use it? Or is there some way to avoid that method being called altogether? Thanks, Michael On Feb 14, 2009, at 8:27 AM, Julian Leviston wrote:> > Actionmailer is a bit different because the mail has it''s own view > which has no controller. You''d have to pass the controller in through > the message to the mail when you''re delivering or building it. > > Blog: http://random8.zenunit.com/ > Learn rails: http://sensei.zenunit.com/ > > On 14/02/2009, at 9:10 AM, "Michael J. I. Jackson" > <mjijackson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> >> I''m getting a NoMethodError using Rails 2.1.0 when trying to send an >> email using ActionMailer. The error is being thrown from the >> template_format method in ActionView''s base.rb file. Apparently the >> controller.request object is an instance of DummyClass (according to >> the exception trace) instead of ActionController::Request, and >> therefore does not have any useful methods associated with it. >> >> Right now I''m thinking that because the ActionMailer doesn''t actually >> represent a separate request per se, that the request object is not >> being created correctly. Thus, when it goes to create the email using >> the template, it doesn''t really know what format to use. Just a >> hunch. >> >> I''m kind of a Rails newb, so any help with this issue would be >> greatly >> appreciated. Just let me know if you need to know any other >> information. >> >> Michael >> >> >>> > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---