提交 fa159d31 编写于 作者: V Vijay Dev

move the note after the scaffold files listing

上级 cb02d10d
......@@ -536,21 +536,8 @@ command in your terminal:
$ rails generate scaffold Post name:string title:string content:text
</shell>
This will create a new database table called posts (plural of Post). The table
will have three columns, name (type string), title (type string) and content
(type text). It will also hook this new database up to Rails (details below).
NOTE. While scaffolding will get you up and running quickly, the code it
generates is unlikely to be a perfect fit for your application. You'll most
probably want to customize the generated code. Many experienced Rails developers
avoid scaffolding entirely, preferring to write all or most of their source code
from scratch. Rails, however, makes it really simple to customize templates for
generated models, controllers, views and other source files. You'll find more
information in the "Creating and Customizing Rails Generators &
Templates":generators.html guide.
The scaffold generator will build 17 files in your application, along with some
folders, and edit one more. Here's a quick overview of what it creates:
The scaffold generator will build several files in your application, along with some
folders, and edit <tt>config/routes.rb</tt>. Here's a quick overview of what it creates:
|_.File |_.Purpose|
|db/migrate/20100207214725_create_posts.rb |Migration to create the posts table in your database (your name will include a different timestamp)|
......@@ -571,6 +558,15 @@ folders, and edit one more. Here's a quick overview of what it creates:
|test/unit/helpers/posts_helper_test.rb |Unit testing harness for the posts helper|
|config/routes.rb |Edited to include routing information for posts|
NOTE. While scaffolding will get you up and running quickly, the code it
generates is unlikely to be a perfect fit for your application. You'll most
probably want to customize the generated code. Many experienced Rails developers
avoid scaffolding entirely, preferring to write all or most of their source code
from scratch. Rails, however, makes it really simple to customize templates for
generated models, controllers, views and other source files. You'll find more
information in the "Creating and Customizing Rails Generators &
Templates":generators.html guide.
h4. Running a Migration
One of the products of the +rails generate scaffold+ command is a _database
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册