Rails Solutions_ Ruby on Rails Made Easy - Williams_ Justin.pdf

(4788 KB) Pobierz
306895944 UNPDF
Create dynamic web applications as
painlessly as possible—no programming
knowledge required
Enhance your user experience easily
with Ajax techniques—Rails makes it
easy for you
Filled with practical techniques
you can use right away
Justin Williams
306895944.031.png 306895944.032.png 306895944.033.png 306895944.034.png 306895944.001.png 306895944.002.png 306895944.003.png 306895944.004.png 306895944.005.png 306895944.006.png 306895944.007.png 306895944.008.png 306895944.009.png 306895944.010.png 306895944.011.png 306895944.012.png 306895944.013.png 306895944.014.png 306895944.015.png 306895944.016.png 306895944.017.png 306895944.018.png 306895944.019.png 306895944.020.png 306895944.021.png 306895944.022.png 306895944.023.png 306895944.024.png 306895944.025.png
Rails Solutions
Ruby on Rails Made Easy
Justin Williams
306895944.026.png 306895944.027.png
Rails Solutions: Ruby on Rails Made Easy
Copyright © 2007 by Justin Williams
All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means,
electronic or mechanical, including photocopying, recording, or by any information storage or retrieval
system, without the prior written permission of the copyright owner and the publisher.
ISBN-13 (pbk): 978-1-59059-752-1
ISBN-10 (pbk): 1-59059-752-4
Printed and bound in the United States of America 9 8 7 6 5 4 3 2 1
Trademarked names may appear in this book. Rather than use a trademark symbol with every occurrence
of a trademarked name, we use the names only in an editorial fashion and to the benefit of the trademark
owner, with no intention of infringement of the trademark.
Distributed to the book trade worldwide by Springer-Verlag New York, Inc., 233 Spring Street, 6th Floor,
New York, NY 10013. Phone 1-800-SPRINGER, fax 201-348-4505, e-mail orders-ny@springer-sbm.com,
or visit www.springeronline.com.
For information on translations, please contact Apress directly at 2560 Ninth Street, Suite 219,
Berkeley, CA 94710. Phone 510-549-5930, fax 510-549-5939, e-mail info@apress.com,
or visit www.apress.com.
The information in this book is distributed on an “as is” basis, without warranty. Although every precaution
has been taken in the preparation of this work, neither the author(s) nor Apress shall have any liability to
any person or entity with respect to any loss or damage caused or alleged to be caused directly or
indirectly by the information contained in this work.
The source code for this book is freely available to readers at www.friendsofed.com in the
Downloads section.
Credits
Lead Editor
Chris Mills
Copy Editor
Nancy Sixsmith
Technical Reviewers
Ashish Bansal
Ryan J. Bonnell
Assistant Production Director
Kari Brooks-Copony
Editorial Board
Steve Anglin
Ewan Buckingham
Gary Cornell
Jason Gilmore
Jonathan Gennick
Jonathan Hassell
James Huddleston
Chris Mills
Matthew Moodie
Dominic Shakeshaft
Jim Sumser
Keir Thomas
Matt Wade
Production Editor
Katie Stence
Compositor
Molly Sharp
Artist
April Milne
Proofreader
Linda Seifert
Indexer
Michael Brinkman
Project Manager
Beth Christmas
Interior and Cover Designer
Kurt Krames
Copy Edit Manager
Nicole Flores
Manufacturing Director
Tom Debolski
306895944.028.png
CONTENTS AT A GLANCE
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv
Chapter 1: Introduction to Ruby on Rails . . . . . . . . . . . . . . . . . . . . 3
Chapter 2: Installing Rails . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Chapter 3: Ruby for Rails Developers . . . . . . . . . . . . . . . . . . . . . . 39
Chapter 4: Getting Started with Rails . . . . . . . . . . . . . . . . . . . . . . 53
Chapter 5: More Advanced Rails . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Chapter 6: Formatting Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Chapter 7: Introduction to Ajax . . . . . . . . . . . . . . . . . . . . . . . . . 117
Chapter 8: Bringing Forms to Life with Ajax . . . . . . . . . . . . . . . 127
Chapter 9: Uploading Files and Sending Attachments . . . . . . . . 149
Chapter 10: User Authentication and Session Management . . . 161
Chapter 11: Customizing Rails Views . . . . . . . . . . . . . . . . . . . . . 183
306895944.029.png
CONTENTS AT A GLANCE
Chapter 12: Using Rails Plug-ins and Engines . . . . . . . . . . . . . . . 203
Chapter 13: Deploying with Capistrano . . . . . . . . . . . . . . . . . . . 223
Appendix A: Caching Your Content . . . . . . . . . . . . . . . . . . . . . . 239
Appendix B: Testing Rails . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261
iv
306895944.030.png
Zgłoś jeśli naruszono regulamin