Forum: Ruby on Rails difference between model and scaffold generators

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Cdcdda30ac4e349c6ffd0819b9e1666f?d=identicon&s=25 Jay Pangmi (jaeezzy)
on 2008-10-05 17:01
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: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..
81b61875e41eaa58887543635d556fca?d=identicon&s=25 Frederick Cheung (Guest)
on 2008-10-05 17:50
(Received via mailing list)
On Oct 5, 4:01 pm, Jay Pangmi <rails-mailing-l...@andreas-s.net>
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
C1e5a9e9344b6d31b9df7303e6dc378a?d=identicon&s=25 Craig White (Guest)
on 2008-10-05 17:55
(Received via mailing list)
On Sun, 2008-10-05 at 08:48 -0700, Frederick Cheung 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
8fa0f5c2bf8ad238baa4e20cb0360ebd?d=identicon&s=25 Matt Harrison (iwasinnamuknow)
on 2008-10-05 18:12
(Received via mailing list)
Jay Pangmi 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
Cdcdda30ac4e349c6ffd0819b9e1666f?d=identicon&s=25 Jay Pangmi (jaeezzy)
on 2008-10-06 03:20
Matt Harrison 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...
This topic is locked and can not be replied to.