# Difference between model and scaffold generators

**URL:** <https://www.ruby-forum.com/t/difference-between-model-and-scaffold-generators/150188>\
**Category:** Rails\
**Created:** [October 5, 2008, 5:01pm UTC](https://www.ruby-forum.com/t/difference-between-model-and-scaffold-generators/150188 "2008-10-05T17:01:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jicksta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/7ba0ec/32.png) [@jicksta](https://www.ruby-forum.com/u/jicksta)\
**Post date:** [October 5, 2008, 5:01pm UTC](https://www.ruby-forum.com/t/difference-between-model-and-scaffold-generators/150188/1 "2008-10-05T17:01:19Z")

</div>

Hi, among lots other confusions herez one… I found two kinda similar  
(:to me) =\>  
script/generate model business name:string address:string  
location\_id:integer  
AND  
script/generate scaffold business name:string address:string  
location\_id:integer

but with model I couldn’t do this:  
[http://localhost](http://localhost):port-number/businesses

but with scaffold this url came with the option to give input which is  
saved in the database.

So, I don’t use model but scaffold. So, can someone plz lighten me up on  
this. thnx…

---

<div class="post-metadata">

**Author:** ![jicksta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/7ba0ec/32.png) [@jicksta](https://www.ruby-forum.com/u/jicksta)\
**Post date:** [October 5, 2008, 5:50pm UTC](https://www.ruby-forum.com/t/difference-between-model-and-scaffold-generators/150188/2 "2008-10-05T17:50:04Z")

</div>

On Oct 5, 4:01 pm, Jay P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> but with scaffold this url came with the option to give input which is  
> saved in the database.
> 
> So, I don’t use model but scaffold. So, can someone plz lighten me up on  
> this. thnx…

model just genenates the model. Scaffold generates a controller and  
views too.

Fred

---

<div class="post-metadata">

**Author:** ![jicksta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/7ba0ec/32.png) [@jicksta](https://www.ruby-forum.com/u/jicksta)\
**Post date:** [October 5, 2008, 5:55pm UTC](https://www.ruby-forum.com/t/difference-between-model-and-scaffold-generators/150188/3 "2008-10-05T17:55:24Z")

</div>

On Sun, 2008-10-05 at 08:48 -0700, Frederick C. wrote:

> > location\_id:integer  
> > views too.

* * *

correct me if I’m wrong but I thought…

script/generate model SOME\_MODEL

would also generate a migration script too

Craig

---

<div class="post-metadata">

**Author:** ![jicksta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/7ba0ec/32.png) [@jicksta](https://www.ruby-forum.com/u/jicksta)\
**Post date:** [October 6, 2008, 3:20am UTC](https://www.ruby-forum.com/t/difference-between-model-and-scaffold-generators/150188/4 "2008-10-06T03:20:12Z")

</div>

Matt H. wrote:

> “./script/generate model mymodelname” creates an activerecord model that  
> is usually linked to a database but doesn’t have to be.
> 
> “./script/generate scaffold scaffoldname” creates a model, a controller,  
> a layout, some css styles etc. This gives you the model plus everything  
> else you would need to play with it.
> 
> This doesn’t mean that scaffolding should be used all the time, it is  
> good for quick development but it isn’t customisable enough and isn’t  
> supposed to be used in a production environment.
> 
> Hope this helps
> 
> Matt

thnx guys…

---

<div class="post-metadata">

**Author:** ![jicksta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/7ba0ec/32.png) [@jicksta](https://www.ruby-forum.com/u/jicksta)\
**Post date:** [October 5, 2008, 6:12pm UTC](https://www.ruby-forum.com/t/difference-between-model-and-scaffold-generators/150188/5 "2008-10-05T18:12:48Z")

</div>

Jay P. wrote:

> but with scaffold this url came with the option to give input which is  
> saved in the database.
> 
> So, I don’t use model but scaffold. So, can someone plz lighten me up on  
> this. thnx…

“./script/generate model mymodelname” creates an activerecord model that  
is usually linked to a database but doesn’t have to be.

“./script/generate scaffold scaffoldname” creates a model, a controller,  
a layout, some css styles etc. This gives you the model plus everything  
else you would need to play with it.

This doesn’t mean that scaffolding should be used all the time, it is  
good for quick development but it isn’t customisable enough and isn’t  
supposed to be used in a production environment.

Hope this helps

Matt
