Scaffolding
For centuries, scaffolding has helped builders provide access and
support to buildings through the early stages of the construction
process. Programmers, too, use temporary scaffolding code to lend
structure and support until more permanent code is available. Rails
automates scaffolding to make early coding more productive than
ever before.
In almost any Ruby on Rails demonstration of
five minutes or more, you're likely to see scaffolding. Rails
opponents dismiss the feature quickly, saying that any scaffolding
code must be thrown away, so the advantages are artificial. In some ways, the detractors
are right. Scaffolding user interfaces are ugly and incomplete. But
scaffolding provides more than cheap demo thrills. Here are some
benefits:
-
You can quickly get code in front of your users
for feedback.
-
You are motivated by faster success.
-
You can learn how Rails works by looking at
generated code.
-
You can use the scaffolding as a foundation to
jumpstarts your development.
-
You can use metaprogramming that's automatically
updated as the structure in the database changes.
In this chapter, we'll show how to use
scaffolding to build a primitive user interface for Photo Share.
Then, in later chapters, we will extend that foundation to flesh
out our application.
|