# Design decision

**URL:** <https://www.ruby-forum.com/t/design-decision/195634>\
**Category:** Rails\
**Created:** [September 27, 2010, 2:30pm UTC](https://www.ruby-forum.com/t/design-decision/195634 "2010-09-27T14:30:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ssmithstone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/51bf81/32.png) [@ssmithstone](https://www.ruby-forum.com/u/ssmithstone)\
**Post date:** [September 27, 2010, 2:30pm UTC](https://www.ruby-forum.com/t/design-decision/195634/1 "2010-09-27T14:30:28Z")

</div>

Trying to make my controllers as skinny as possible , so come across a  
design issue if I want to send out an email when a model is created  
would I put this functionality on the after\_create method or inside of  
the controller after the #save method

---

<div class="post-metadata">

**Author:** ![ssmithstone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/51bf81/32.png) [@ssmithstone](https://www.ruby-forum.com/u/ssmithstone)\
**Post date:** [September 27, 2010, 3:03pm UTC](https://www.ruby-forum.com/t/design-decision/195634/2 "2010-09-27T15:03:51Z")

</div>

If I understand the requirement, then the creation of an e-mail is the  
business of the model.

Controller should be deciding “After creation of model X, what view does  
the user see? To the index view, the show view of the model just  
created, or back to the view the user was at before creating the model?”

---

<div class="post-metadata">

**Author:** ![ssmithstone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/51bf81/32.png) [@ssmithstone](https://www.ruby-forum.com/u/ssmithstone)\
**Post date:** [September 27, 2010, 7:42pm UTC](https://www.ruby-forum.com/t/design-decision/195634/3 "2010-09-27T19:42:00Z")

</div>

on the model , if it happens often(if you are sending lots of mails) use  
a  
plugin to send it to another thread, and you can also use observers.

---

<div class="post-metadata">

**Author:** ![ssmithstone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/51bf81/32.png) [@ssmithstone](https://www.ruby-forum.com/u/ssmithstone)\
**Post date:** [September 28, 2010, 1:08pm UTC](https://www.ruby-forum.com/t/design-decision/195634/4 "2010-09-28T13:08:04Z")

</div>

I picked up the spawn plugin to thread the mailer and will go with  
moving the business logic to the model cheers for the input guys
