Wiley Professional Ruby on Rails 978-0-470-22388-8 Manuel D’Utilisation
Codes de produits
978-0-470-22388-8
Building Resources
Ruby on Rails is opinionated software. This doesn ’ t mean that it ’ s going to make fun of your
haircut, or tell you what kind of car to drive. It does mean that Rails has definite ideas about how
your web project should be structured, how it should interact with a database, how you should
test, and even what kinds of tools you should use. Tasks that Rails feels that you should do often
are easy, and tasks that Rails thinks should be rare are (usually) possible but more complicated.
This works because the Rails team has done an exceptionally good job of deciding how web
projects should work, and how they should not work.
haircut, or tell you what kind of car to drive. It does mean that Rails has definite ideas about how
your web project should be structured, how it should interact with a database, how you should
test, and even what kinds of tools you should use. Tasks that Rails feels that you should do often
are easy, and tasks that Rails thinks should be rare are (usually) possible but more complicated.
This works because the Rails team has done an exceptionally good job of deciding how web
projects should work, and how they should not work.
Two important principles that Rails favors are especially useful when starting a new Rails project:
Representational State Transfer (REST) is a relatively new mechanism for structuring a Rails
application by organizing the application around resources, rather than pages.
application by organizing the application around resources, rather than pages.
Test Driven Development (TDD) is an important part of ensuring the correctness and design
of any software project, but Rails does a particularly good job of providing the developer
with the tools needed for easy and powerful automated testing.
of any software project, but Rails does a particularly good job of providing the developer
with the tools needed for easy and powerful automated testing.
In this chapter, you will begin the construction of the Rails project that will carry you throughout
the book. This will enable you to review the basic Rails functionality you should already be
familiar with, but with an added emphasis on REST and TDD. At the end of this chapter, your
Rails knowledge should be refreshed, state - of - the - art, and ready to go.
the book. This will enable you to review the basic Rails functionality you should already be
familiar with, but with an added emphasis on REST and TDD. At the end of this chapter, your
Rails knowledge should be refreshed, state - of - the - art, and ready to go.
To run the examples throughout this book, a standard suite of applications is assumed to already
be installed on your computer. The suite includes Ruby, Rails, MySQL, and Subversion.
See Appendix A , “ Things You Should Download, ” for details on how to install these tools.
be installed on your computer. The suite includes Ruby, Rails, MySQL, and Subversion.
See Appendix A , “ Things You Should Download, ” for details on how to install these tools.
A Good Place to Star t
The sample application that drives this book is called Soups OnLine, your Web 2.0 guide to all
things hot and broth - y. As the site develops, it will have all sorts of modern web goodness,
including an Ajax interface, social networking and content development, RSS syndication, and
things hot and broth - y. As the site develops, it will have all sorts of modern web goodness,
including an Ajax interface, social networking and content development, RSS syndication, and
❑
❑
c01.indd 1
c01.indd 1
1/30/08 4:02:20 PM
1/30/08 4:02:20 PM
COPYRIGHTED MATERIAL