On Aug 7, 11:54 pm, Phlip <[email protected]> wrote: > Ilan Berci wrote: > > While not knowing your problem domain at all, I have a preference for > > thin dumb controllers (that fit easily within REST), I would move the > > mailer down into models/ or lib/ > > > hth > > ilan > > +1 (FWIW!) > > Views should be dumb, Controllers thin, and Models fat. > > If the deliver_ call were one line, it qualifies for the Controller. But... > > The delivered template is itself a View. Hence it should be dumb. Hence > anything > powering it belongs in the _Model_, where fat things belong. > > -- > Phlip
Opinions opinions, oh my! As I guess has been the general theme of this thread, it really depends on the context in which the mailing is taking place. If its as simple as user clicking a button on your site and in turn some mail goes out, that's controller domain. But if the mailing is part of some more complex logic (simple example: user signs up; requested name needs to be checked, perhaps an invite token counter needs to be decremented, maybe you'll queue this ish etc, and the email goes out at the end), then you'll call the mailer in the part of the model that handles that processing. Send an emailing is a *general enough activity* that there are no rules that say where you should do it in the MVC context. --~--~---------~--~----~------------~-------~--~----~ 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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

