# What is the optimal number of controllers for this?

**URL:** <https://www.ruby-forum.com/t/what-is-the-optimal-number-of-controllers-for-this/125487>\
**Category:** Rails\
**Created:** [January 9, 2008, 4:08pm UTC](https://www.ruby-forum.com/t/what-is-the-optimal-number-of-controllers-for-this/125487 "2008-01-09T16:08:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [January 9, 2008, 4:08pm UTC](https://www.ruby-forum.com/t/what-is-the-optimal-number-of-controllers-for-this/125487/1 "2008-01-09T16:08:44Z")

</div>

Hi,

I’m still adjusting to Ruby on Rails and the MVC model. But I wanted  
to query the group on what the best design is – i.e. how many  
controllers should I have for the following. A customer will register  
on our site to order a product. After registration, or if they leave  
and decide to log in again, they can place their orders through a pre-  
built order form. After placing the order, they see a thank you  
screen and receive a confirmation email.

What is the best number of controllers (and which ones) should I  
create for this?

Thanks, - Dave

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [January 9, 2008, 4:23pm UTC](https://www.ruby-forum.com/t/what-is-the-optimal-number-of-controllers-for-this/125487/2 "2008-01-09T16:23:24Z")

</div>

I would think you’ll need 3.

Customers  
Products  
Orders

Each customer has\_many orders, and each order has\_many products. But  
you also might need something for payments also, depending on how you  
process them.

-Ryan

On Jan 9, 9:08 am, “removed\_email\_address@domain.invalid”
