没有合适的资源?快使用搜索试试~ 我知道了~
首页Agile Web Development with Rails 2 Edition正式版
资源详情
资源评论
资源推荐
Important Information
About Rails Versions
Rails is an evolving framework. The core Rails developers are continually
making changes, adding new features, fixing bugs, and so on. Periodically
they package up the latest version of Rails into a release. These releases are
then available to application developers as RubyGems.
This book is written for Rails 1.2.
As the book is going to press the core team have crea ted the codebase for
Rails 1.2. However, they have not yet packaged it into a gem. This gives us a
bit of a problem. We want the book to reflect all the latest and greatest Rails
features, but we also know that it is hard for folks to jump through the hoops
required to get the so-called Edge version of Rails installed on their systems.
And until a gem is availa b le, the 1.2 features are only a vailable in Ed ge Rails.
Now, i t may well be that by the time you get your hands on this book, the
Rails 1.2 gem is out. It’s easy to find out. After you’ve installed Rails (as
described in Chapter
3, Installing Rails, on page 31), bring up a command
prompt and enter
rails -v. If it reports “Rails 1.2” or la ter, you’re fine.
If instead you see something like “Rails 1.1.6,” you’ll need to update to g et
the code in this b ook to run. We’ve prepared a snapshot of the Ra ils frame-
work code that we used when writing this book. You can install it i n your
own Rails applications as a temporary measure until 1.2 is released.
• Create your applica tion normally. You’ll find that it will contain a dir ec-
tory called vendor
• Download http://media.pragprog.com/titles/rails2/code/rails.zip into your
application’s
vendor directory and unzip it. It should create a new direc-
tory called
rails
• In your applica tion’s top-level directory, issu e the command
rake rails:update
Once Rails 1.2 is released, you can install it and remove the directory tree
vendor/rails from your applications.
The version of Rails from our web site is not an official release, and should
not be used in producti on applications.
Dave Thomas
Agil e Web Develo pment with Rails
Second Edition
Dave Thomas
David Heinemeier Hansson
with
Leon Breedt
Mike Clark
James Duncan Davi d son
Justin Gehtland
Andreas Schwarz
The Pragmatic Bookshelf
Raleigh, North Carolina Dallas, Texas
Many of the designations used by manufacturers and sellers to distinguish their products are
claimed as trademarks. Where those designations appear in this book, and The Pragmatic Program-
mers, LLC was aware of a trademark claim, the designati ons have been printed in initial capital
letters or in all capital s. The Pragmatic Starter Kit, The Pragmatic Programmer, Pragmatic Program-
ming, Pragmatic Bookshelf and the linking g device are trademarks of The Pragmatic Programmers,
LLC.
Every precaution was taken in the preparation of this book . However, the publisher assumes no
responsibility for errors or omissions, or for damages that may result from the use of information
(including program listings) contained herein.
Our Pragmatic courses, workshops, and other products can help you and your team create better
software and have more fun. For more information, as w ell as the latest Pragmatic ti tles, please
visit us at
http://www.pragmaticprogra mmer.com
Copyright
©
2007 The Pragmatic Programmers LLC.
All rights reserved.
No part of this publication may be reproduced, stored i n a retrieval system, or transmitted, in any
form, or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the
prior consent of the publisher.
Printed in the United States of America.
ISBN-10: 0-977 6166-3-0
ISBN-13: 978-0-9776166-3-3
Printed on acid-free paper with 85% recycled, 30% post-consumer content.
P2.00 printing, January 15, 2007
Version: 2007-1-8
Con t ents
Preface to the Second Edition 12
1 Introduction 14
1.1 Rails Is Agile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
1.2 Finding Your Way Around . . . . . . . . . . . . . . . . . . . . . 17
1.3 Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Part I—Getting Started 21
2 The Architecture of Rails Applications 22
2.1 Models, Views, and Controll ers . . . . . . . . . . . . . . . . . . 22
2.2 Active Record: Rails Model Support . . . . . . . . . . . . . . . . 25
2.3 Action Pack: The View and Controller . . . . . . . . . . . . . . 29
3 Installing Rails 31
3.1 Your Shopping List . . . . . . . . . . . . . . . . . . . . . . . . . 31
3.2 Installing on Windows . . . . . . . . . . . . . . . . . . . . . . . . 32
3.3 Installing on Mac OS X . . . . . . . . . . . . . . . . . . . . . . . 34
3.4 Installing on Linux . . . . . . . . . . . . . . . . . . . . . . . . . . 35
3.5 Development Environments . . . . . . . . . . . . . . . . . . . . 36
3.6 Rails and Databases . . . . . . . . . . . . . . . . . . . . . . . . . 39
3.7 Keeping Up-to-Date . . . . . . . . . . . . . . . . . . . . . . . . . 42
3.8 Rails and ISPs . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
4 Instant Gratification 43
4.1 Creating a New Application . . . . . . . . . . . . . . . . . . . . . 43
4.2 Hello, Rails! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
4.3 Linking Pages Together . . . . . . . . . . . . . . . . . . . . . . . 56
4.4 What We Just Did . . . . . . . . . . . . . . . . . . . . . . . . . . 59
剩余714页未读,继续阅读
kakazhe
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 收起
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
会员权益专享
最新资源
- c++校园超市商品信息管理系统课程设计说明书(含源代码) (2).pdf
- 建筑供配电系统相关课件.pptx
- 企业管理规章制度及管理模式.doc
- vb打开摄像头.doc
- 云计算-可信计算中认证协议改进方案.pdf
- [详细完整版]单片机编程4.ppt
- c语言常用算法.pdf
- c++经典程序代码大全.pdf
- 单片机数字时钟资料.doc
- 11项目管理前沿1.0.pptx
- 基于ssm的“魅力”繁峙宣传网站的设计与实现论文.doc
- 智慧交通综合解决方案.pptx
- 建筑防潮设计-PowerPointPresentati.pptx
- SPC统计过程控制程序.pptx
- SPC统计方法基础知识.pptx
- MW全能培训汽轮机调节保安系统PPT教学课件.pptx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0