forked from railstutorial-china/rails42
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
345 lines (333 loc) · 14.1 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8"/>
<title>Ruby on Rails 教程 - 目录</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="description" content="最好的 Ruby on Rails 入门教程"/>
<meta name="keywords" content="ruby, rails, tutorial"/>
<meta name="author" content="Michael Hartl"/>
<meta name="translator" content="安道"/>
<meta name="generator" content="persie 0.0.1.alpha.3"/>
<link rel="stylesheet" type="text/css" href="http://cdn.staticfile.org/twitter-bootstrap/3.2.0/css/bootstrap.min.css"/>
<link rel="stylesheet" type="text/css" href="http://cdn.staticfile.org/font-awesome/4.2.0/css/font-awesome.min.css"/>
<link rel="stylesheet" type="text/css" href="assets/style.css"/>
<script type="text/javascript" src="http://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript" src="http://cdn.staticfile.org/twitter-bootstrap/3.2.0/js/collapse.min.js"></script>
<script type="text/javascript" src="assets/global.js"></script>
</head>
<body>
<header class="navbar navbar-default navbar-fixed-top navbar-book">
<div class="container">
<div class="navbar-header">
<a href="http://railstutorial-china.org" class="navbar-brand">Ruby on Rails 教程</a>
<button class="navbar-toggle collapsed" type="button" data-toggle="collapse" data-target=".book-navbar-collapse">
<span class="sr-only">导航</span>
<i class="fa fa-bars"></i>
</button>
<a href="http://railstutorial-china.org/#purchase" id="navbar-purchase-xs" class="btn btn-warning navbar-btn visible-xs collapsed-purchase-btn">购买</a>
</div>
<nav class="collapse navbar-collapse book-navbar-collapse">
<ul class="nav navbar-nav navbar-right">
<li><a href="http://railstutorial-china.org" title="首页">首页</a></li>
<li class="active"><a href="http://railstutorial-china.org/read/" title="在线阅读">阅读</a></li>
<li><a href="http://railstutorial-china.org/blog/" title="最新消息">博客</a></li>
<li><a href="https://selfstore.io/products/189/topics" title="论坛">论坛</a></li>
<li class="hidden-xs"><div><a href="http://railstutorial-china.org/#purchase" id="navbar-purchase" class="btn btn-warning navbar-btn" title="购买电子书">购买</a></div></li>
</ul>
</nav>
</div>
</header>
<div class="content">
<div class="container">
<div class="row">
<div class="col-lg-offset-2 col-lg-8">
<article class="article">
<nav data-type="toc" class="toc">
<h1>目录</h1>
<ol>
<li data-type="foreword">
<a href="to-reader.html#_致中国读者">致中国读者</a>
</li>
<li data-type="foreword">
<a href="foreword.html#_序">序</a>
</li>
<li data-type="acknowledgment">
<a href="acknowledgments.html#_致谢">致谢</a>
</li>
<li data-type="author">
<a href="author.html#_作者译者简介">作者译者简介</a>
</li>
<li data-type="license">
<a href="license.html#_版权和代码授权协议">版权和代码授权协议</a>
</li>
<li data-type="chapter">
<a href="chapter1.html#from-zero-to-deploy"><span class="title-label">第 1 章</span> 从零开始,完成一次部署</a>
<ol>
<li data-type="sect1">
<a href="chapter1.html#introduction"><span class="title-label">1.1. </span> 简介</a>
</li>
<li data-type="sect1">
<a href="chapter1.html#up-and-running"><span class="title-label">1.2. </span> 搭建环境</a>
</li>
<li data-type="sect1">
<a href="chapter1.html#the-first-application"><span class="title-label">1.3. </span> 第一个应用</a>
</li>
<li data-type="sect1">
<a href="chapter1.html#version-control-with-git"><span class="title-label">1.4. </span> 使用 Git 做版本控制</a>
</li>
<li data-type="sect1">
<a href="chapter1.html#deploying"><span class="title-label">1.5. </span> 部署</a>
</li>
<li data-type="sect1">
<a href="chapter1.html#beginning-conclusion"><span class="title-label">1.6. </span> 小结</a>
</li>
<li data-type="sect1">
<a href="chapter1.html#beginning-exercises"><span class="title-label">1.7. </span> 练习</a>
</li>
</ol>
</li>
<li data-type="chapter">
<a href="chapter2.html#a-toy-app"><span class="title-label">第 2 章</span> 玩具应用</a>
<ol>
<li data-type="sect1">
<a href="chapter2.html#planning-the-application"><span class="title-label">2.1. </span> 规划应用</a>
</li>
<li data-type="sect1">
<a href="chapter2.html#the-users-resource"><span class="title-label">2.2. </span> 用户资源</a>
</li>
<li data-type="sect1">
<a href="chapter2.html#the-microposts-resource"><span class="title-label">2.3. </span> 微博资源</a>
</li>
<li data-type="sect1">
<a href="chapter2.html#a-toy-app-conclusion"><span class="title-label">2.4. </span> 小结</a>
</li>
<li data-type="sect1">
<a href="chapter2.html#a-toy-app-exercises"><span class="title-label">2.5. </span> 练习</a>
</li>
</ol>
</li>
<li data-type="chapter">
<a href="chapter3.html#mostly-static-pages"><span class="title-label">第 3 章</span> 基本静态的页面</a>
<ol>
<li data-type="sect1">
<a href="chapter3.html#sample-app-setup"><span class="title-label">3.1. </span> 创建演示应用</a>
</li>
<li data-type="sect1">
<a href="chapter3.html#static-pages"><span class="title-label">3.2. </span> 静态页面</a>
</li>
<li data-type="sect1">
<a href="chapter3.html#getting-started-with-testing"><span class="title-label">3.3. </span> 开始测试</a>
</li>
<li data-type="sect1">
<a href="chapter3.html#slightly-dynamic-pages"><span class="title-label">3.4. </span> 有点动态内容的页面</a>
</li>
<li data-type="sect1">
<a href="chapter3.html#mostly-static-pages-conclusion"><span class="title-label">3.5. </span> 小结</a>
</li>
<li data-type="sect1">
<a href="chapter3.html#mostly-static-pages-exercises"><span class="title-label">3.6. </span> 练习</a>
</li>
<li data-type="sect1">
<a href="chapter3.html#advanced-testing-setup"><span class="title-label">3.7. </span> 高级测试技术</a>
</li>
</ol>
</li>
<li data-type="chapter">
<a href="chapter4.html#rails-flavored-ruby"><span class="title-label">第 4 章</span> Rails 背后的 Ruby</a>
<ol>
<li data-type="sect1">
<a href="chapter4.html#motivation"><span class="title-label">4.1. </span> 导言</a>
</li>
<li data-type="sect1">
<a href="chapter4.html#strings-and-methods"><span class="title-label">4.2. </span> 字符串和方法</a>
</li>
<li data-type="sect1">
<a href="chapter4.html#other-data-structures"><span class="title-label">4.3. </span> 其他数据类型</a>
</li>
<li data-type="sect1">
<a href="chapter4.html#ruby-classes"><span class="title-label">4.4. </span> Ruby 类</a>
</li>
<li data-type="sect1">
<a href="chapter4.html#rails-flavored-ruby-conclusion"><span class="title-label">4.5. </span> 小结</a>
</li>
<li data-type="sect1">
<a href="chapter4.html#rails-flavored-ruby-exercises"><span class="title-label">4.6. </span> 练习</a>
</li>
</ol>
</li>
<li data-type="chapter">
<a href="chapter5.html#filling-in-the-layout"><span class="title-label">第 5 章</span> 完善布局</a>
<ol>
<li data-type="sect1">
<a href="chapter5.html#adding-some-structure"><span class="title-label">5.1. </span> 添加一些结构</a>
</li>
<li data-type="sect1">
<a href="chapter5.html#sass-and-the-asset-pipeline"><span class="title-label">5.2. </span> Sass 和 Asset Pipeline</a>
</li>
<li data-type="sect1">
<a href="chapter5.html#layout-links"><span class="title-label">5.3. </span> 布局中的链接</a>
</li>
<li data-type="sect1">
<a href="chapter5.html#user-signup-a-first-step"><span class="title-label">5.4. </span> 用户注册:第一步</a>
</li>
<li data-type="sect1">
<a href="chapter5.html#filling-in-the-layout-conclusion"><span class="title-label">5.5. </span> 小结</a>
</li>
<li data-type="sect1">
<a href="chapter5.html#filling-in-the-layout-exercises"><span class="title-label">5.6. </span> 练习</a>
</li>
</ol>
</li>
<li data-type="chapter">
<a href="chapter6.html#modeling-users"><span class="title-label">第 6 章</span> 用户模型</a>
<ol>
<li data-type="sect1">
<a href="chapter6.html#user-model"><span class="title-label">6.1. </span> 用户模型</a>
</li>
<li data-type="sect1">
<a href="chapter6.html#user-validations"><span class="title-label">6.2. </span> 用户数据验证</a>
</li>
<li data-type="sect1">
<a href="chapter6.html#adding-a-secure-password"><span class="title-label">6.3. </span> 添加安全密码</a>
</li>
<li data-type="sect1">
<a href="chapter6.html#modeling-users-conclusion"><span class="title-label">6.4. </span> 小结</a>
</li>
<li data-type="sect1">
<a href="chapter6.html#modeling-users-exercises"><span class="title-label">6.5. </span> 练习</a>
</li>
</ol>
</li>
<li data-type="chapter">
<a href="chapter7.html#sign-up"><span class="title-label">第 7 章</span> 注册</a>
<ol>
<li data-type="sect1">
<a href="chapter7.html#showing-users"><span class="title-label">7.1. </span> 显示用户的信息</a>
</li>
<li data-type="sect1">
<a href="chapter7.html#signup-form"><span class="title-label">7.2. </span> 注册表单</a>
</li>
<li data-type="sect1">
<a href="chapter7.html#unsuccessful-signups"><span class="title-label">7.3. </span> 注册失败</a>
</li>
<li data-type="sect1">
<a href="chapter7.html#successful-signups"><span class="title-label">7.4. </span> 注册成功</a>
</li>
<li data-type="sect1">
<a href="chapter7.html#professional-grade-deployment"><span class="title-label">7.5. </span> 专业部署方案</a>
</li>
<li data-type="sect1">
<a href="chapter7.html#sign-up-conclusion"><span class="title-label">7.6. </span> 小结</a>
</li>
<li data-type="sect1">
<a href="chapter7.html#sign-up-exercises"><span class="title-label">7.7. </span> 练习</a>
</li>
</ol>
</li>
<li data-type="chapter">
<a href="chapter8.html#log-in-log-out"><span class="title-label">第 8 章</span> 登录和退出</a>
<ol>
<li data-type="sect1">
<a href="chapter8.html#sessions"><span class="title-label">8.1. </span> 会话</a>
</li>
<li data-type="sect1">
<a href="chapter8.html#logging-in"><span class="title-label">8.2. </span> 登录</a>
</li>
<li data-type="sect1">
<a href="chapter8.html#logging-out"><span class="title-label">8.3. </span> 退出</a>
</li>
<li data-type="sect1">
<a href="chapter8.html#remember-me"><span class="title-label">8.4. </span> 记住我</a>
</li>
<li data-type="sect1">
<a href="chapter8.html#log-in-log-out-conclusion"><span class="title-label">8.5. </span> 小结</a>
</li>
<li data-type="sect1">
<a href="chapter8.html#log-in-log-out-exercises"><span class="title-label">8.6. </span> 练习</a>
</li>
</ol>
</li>
<li data-type="chapter">
<a href="chapter9.html#updating-showing-and-deleting-users"><span class="title-label">第 9 章</span> 更新,显示和删除用户</a>
<ol>
<li data-type="sect1">
<a href="chapter9.html#updating-users"><span class="title-label">9.1. </span> 更新用户</a>
</li>
<li data-type="sect1">
<a href="chapter9.html#authorization"><span class="title-label">9.2. </span> 权限系统</a>
</li>
<li data-type="sect1">
<a href="chapter9.html#showing-all-users"><span class="title-label">9.3. </span> 列出所有用户</a>
</li>
<li data-type="sect1">
<a href="chapter9.html#deleting-users"><span class="title-label">9.4. </span> 删除用户</a>
</li>
<li data-type="sect1">
<a href="chapter9.html#updating-showing-and-deleting-users-conclusion"><span class="title-label">9.5. </span> 小结</a>
</li>
<li data-type="sect1">
<a href="chapter9.html#updating-showing-and-deleting-users-exercises"><span class="title-label">9.6. </span> 练习</a>
</li>
</ol>
</li>
<li data-type="chapter">
<a href="chapter10.html#account-activation-and-password-reset"><span class="title-label">第 10 章</span> 账户激活和密码重设</a>
<ol>
<li data-type="sect1">
<a href="chapter10.html#account-activation"><span class="title-label">10.1. </span> 账户激活</a>
</li>
<li data-type="sect1">
<a href="chapter10.html#password-reset"><span class="title-label">10.2. </span> 密码重设</a>
</li>
<li data-type="sect1">
<a href="chapter10.html#email-in-production"><span class="title-label">10.3. </span> 在生产环境中发送邮件</a>
</li>
<li data-type="sect1">
<a href="chapter10.html#account-activation-and-password-reset-conclusion"><span class="title-label">10.4. </span> 小结</a>
</li>
<li data-type="sect1">
<a href="chapter10.html#account-activation-and-password-reset-exercises"><span class="title-label">10.5. </span> 练习</a>
</li>
<li data-type="sect1">
<a href="chapter10.html#proof-of-expiration-comparison"><span class="title-label">10.6. </span> 证明超时失效的比较算式</a>
</li>
</ol>
</li>
<li data-type="chapter">
<a href="next.html#next">接下来</a>
</li>
</ol>
</nav>
</article>
<div class="navi clearfix">
<div class="pull-right">
<a class="next" href="to-reader.html" title="致中国读者">致中国读者 » </a>
</div>
</div>
</div>
</div>
</div>
</div>
<footer class="footer">
<p>©2013-2015 <a href="http://about.ac" title="安道的网站">安道</a></p>
<p class="sns"><a href="https://twitter.com/andor_chen" title="安道的 Twitter"><i class="fa fa-twitter"></i></a> <a href="http://weibo.com/andor27" title="安道的微博"><i class="fa fa-weibo"></i></a></p>
<p>保留部分权利,禁止转载</p>
</footer>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-56255794-2', 'auto');
ga('send', 'pageview');
$('#navbar-purchase').on('click',function(){
ga('send', 'event', 'button', 'click', 'navbar purchase');
});
$('#navbar-purchase-xs').on('click',function(){
ga('send', 'event', 'button', 'click', 'navbar purchase xs');
});
</script>
</body>
</html>