Ruby on Rails For Dummies
by Barry Burd
Ruby on Rails For Dummies
Published by
Wiley Publishing, Inc.
111 River St.
Hoboken, NJ 07030-5774
www.wiley.com
Copyright 2007 by Wiley Publishing, Inc., Indianapolis, Indiana
Published by Wiley Publishing, Inc., Indianapolis, Indiana
Published simultaneously in Canada
No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permission should be addressed to the Legal Department, Wiley Publishing, Inc., 10475 Crosspoint Blvd., Indianapolis, IN 46256, (317) 572-3447, fax (317) 572-4355, or online at http://www.wiley.com/go/permissions.
Trademarks: Wiley, the Wiley Publishing logo, For Dummies, the Dummies Man logo, A Reference for the Rest of Us!, The Dummies Way, Dummies Daily, The Fun and Easy Way, Dummies.com, and related trade dress are trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affiliates in the United States and other countries, and may not be used without written permission. Ruby on Rails is a trademark of David Heinemeier Hansson. All other trademarks are the property of their respective owners. Wiley Publishing, Inc., is not associated with any product or vendor mentioned in this book.
LIMIT OF LIABILITY/DISCLAIMER OF WARRANTY: The publisher and the author make no representations or warranties with respect to the accuracy or completeness of the contents of this work and specifically disclaim all warranties, including without limitation warranties of fitness for a particular purpose. No warranty may be created or extended by sales or promotional materials. The advice and strategies contained herein may not be suitable for every situation. This work is sold with the understanding that the publisher is not engaged in rendering legal, accounting, or other professional services. If professional assistance is required, the services of a competent professional person should be sought. Neither the publisher nor the author shall be liable for damages arising herefrom. The fact that an organization or Website is referred to in this work as a citation and/or a potential source of further information does not mean that the author or the publisher endorses the information the organization or Website may provide or recommendations it may make. Further, readers should be aware that Internet Websites listed in this work may have changed or disappeared between when this work was written and when it is read.
For general information on our other products and services, please contact our Customer Care Department within the U.S. at 800-762-2974, outside the U.S. at 317-572-3993, or fax 317-572-4002.
For technical support, please visit www.wiley.com/techsupport.
Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not be available in electronic books.
Library of Congress Control Number: 2006936826
ISBN: 978-0-470-08120-4
Manufactured in the United States of America
10 9 8 7 6 5 4 3 2 1
1O/RZ/RS/QW/IN
About the Author
Dr. Barry Burd received an M.S. degree in Computer Science at Rutgers University and a Ph.D. in Mathematics at the University of Illinois. As a teaching assistant in Champaign-Urbana, Illinois, he was elected to the university-wide List of Teachers Ranked as Excellent by Their Students five times.
Since 1980, Dr. Burd has been a professor in the Department of Mathematics and Computer Science at Drew University in Madison, New Jersey. When hes not lecturing at Drew University, Dr. Burd leads training courses for professional programmers in business and industry. He has lectured at conferences in the United States, Europe, Australia, and Asia. He is the author of several articles and books, including Java For Dummies, 4th Edition, and JSP: JavaServer Pages, both from Wiley Publishing, Inc.
Dr. Burd lives in Madison, New Jersey, with his wife and two children. In his spare time, he enjoys being a workaholic.
Dedication
for Harriet, Sam and Jennie, Sam and Ruth, Abram and Katie, Benjamin and Jennie
Authors Acknowledgments
Many thanks to Paul Levesque who worked so closely with me on this project, and thanks to Katie Feltman who headed up the project at Wiley. And to Andy Cummings who steers the For Dummies series, thanks. And, yes, thanks to copy editors Mary Lagu and Virginia Sanders. Also, thanks to Laura Lewin, agent at StudioB. Thanks, and thanks again to Jay Zimmerman and the speakers in the No Fluff, Just Stuff Symposium for opening my eyes to Ruby on Rails. And to Charles Nutter and Thomas Enebo, who bridge the gap between Ruby and Java, thanks. Of course, Matt Kent, Kyle Shank, and Marc Baumbach, thanks for the use of RadRails, both inside and outside of this book. I extend thanks to Stefan Reichert with his Wicked Shell. To Francis Hwang and the members of the Ruby-NYC group, I say thanks. Thanks indeed to Frank Greco and his New York Java Special Interest Group and to Mike Redlich and the gang at the Amateur Computer Group of New Jersey because without them I wouldnt know anything about object-relational mapping. Thanks. And special thanks to Sam and Jennie, and of course, to Harriet, thanks I say thanks I will Thanks.
Publishers Acknowledgments
Were proud of this book; please send us your comments through our online registration form located at www.dummies.com/register/.
Some of the people who helped bring this book to market include the following:
Acquisitions, Editorial, and Media Development
Senior Project Editor: Paul Levesque
Acquisitions Editor: Katie Feltman
Copy Editors: Mary Lagu, Virginia Sanders
Technical Editor: Charles Nutter
Editorial Manager: Leah Cameron
Media Development Specialists: Angela Denny, Kate Jenkins, Steven Kudirka, Kit Malone
Media Development Coordinator: Laura Atkinson
Media Project Supervisor: Laura Moss
Media Development Manager: Laura VanWinkle
Editorial Assistant: Amanda Foxworth
Sr. Editorial Assistant: Cherie Case
Cartoons: Rich Tennant (www.the5thwave.com)
Composition Services
Project Coordinator: Erin Smith
Layout and Graphics: Claudia Bell, Lavonne Cook, Denny Hager, Barbara Moore, Barry Offringa, Laura Pence, Heather Ryan
Proofreaders: Cynthia Fields, Jessica Kramer, Techbooks
Indexer: Techbooks
Anniversary Logo Design: Richard Pacifico
Publishing and Editorial for Technology Dummies