# Number of scaffolds (Controllers)

**URL:** <https://www.ruby-forum.com/t/number-of-scaffolds-controllers/172639>\
**Category:** Rails\
**Created:** [July 24, 2009, 11:54am UTC](https://www.ruby-forum.com/t/number-of-scaffolds-controllers/172639 "2009-07-24T11:54:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![melomane](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/da6949/32.png) [@melomane](https://www.ruby-forum.com/u/melomane)\
**Post date:** [July 24, 2009, 11:54am UTC](https://www.ruby-forum.com/t/number-of-scaffolds-controllers/172639/1 "2009-07-24T11:54:20Z")

</div>

Hi  
Is it a problem in rails application development to have many  
scaffolds ( Specially because of its controllers) ? I know the word  
“many” depends on the project, but it can be meaningful in general  
speaking. This problem can be discussed in two part, one of them is  
from the point of view of software development methods. And the more  
important one, is the performance. Does it affect application  
performance?

---

<div class="post-metadata">

**Author:** ![melomane](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/da6949/32.png) [@melomane](https://www.ruby-forum.com/u/melomane)\
**Post date:** [July 24, 2009, 1:30pm UTC](https://www.ruby-forum.com/t/number-of-scaffolds-controllers/172639/2 "2009-07-24T13:30:35Z")

</div>

melomane wrote:

> Hi  
> Is it a problem in rails application development to have many  
> scaffolds ( Specially because of its controllers) ? I know the word  
> “many” depends on the project, but it can be meaningful in general  
> speaking. This problem can be discussed in two part, one of them is  
> from the point of view of software development methods. And the more  
> important one, is the performance. Does it affect application  
> performance?

WRT performance  
A larger number of controllers will require a larger number of routes,  
and both of these things will take up a little more memory. However i  
would say that this _won’t_ be in your top twenty performance issues to  
tackle. That is unless you’re procedurally generating hundreds of them  
or something. Your optimisation opportunities will involve improving  
your db queries for example.

WRT methodology  
I’d say that it’s better to have more controllers, each of which deals  
with a specific resource in a restful and simple way, than it is to have  
a small number of controllers doing more complicated things, with more  
models etc. In all software, a large number of simple things (whether  
it’s classes or methods or whatever) beats a small number of complicated  
things IMO.

---

<div class="post-metadata">

**Author:** ![melomane](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/da6949/32.png) [@melomane](https://www.ruby-forum.com/u/melomane)\
**Post date:** [July 25, 2009, 6:36am UTC](https://www.ruby-forum.com/t/number-of-scaffolds-controllers/172639/3 "2009-07-25T06:36:35Z")

</div>

And you can use :only and :except options to generate only the required  
routes

ex.  
map.resources :users, :only =\> [:index, :show]

map.resources :users, :only =\> [:update]

Sijo
