Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
3e3ed1ed
R
rails
项目概览
张重言
/
rails
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rails
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
3e3ed1ed
编写于
2月 16, 2014
作者:
V
Vijay Dev
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #13937 from ktaragorn/guides_fixes
Guides fixes
上级
8b80e3c5
8e6d0fd4
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
14 addition
and
3 deletion
+14
-3
guides/source/asset_pipeline.md
guides/source/asset_pipeline.md
+6
-1
guides/source/getting_started.md
guides/source/getting_started.md
+8
-2
未找到文件。
guides/source/asset_pipeline.md
浏览文件 @
3e3ed1ed
...
@@ -1018,7 +1018,8 @@ The X-Sendfile header is a directive to the web server to ignore the response
...
@@ -1018,7 +1018,8 @@ The X-Sendfile header is a directive to the web server to ignore the response
from the application, and instead serve a specified file from disk. This option
from the application, and instead serve a specified file from disk. This option
is off by default, but can be enabled if your server supports it. When enabled,
is off by default, but can be enabled if your server supports it. When enabled,
this passes responsibility for serving the file to the web server, which is
this passes responsibility for serving the file to the web server, which is
faster.
faster. Have a look at
[
send_file
](
http://api.rubyonrails.org/classes/ActionController/DataStreaming.html#method-i-send_file
)
on how to use this feature.
Apache and nginx support this option, which can be enabled in
Apache and nginx support this option, which can be enabled in
`config/environments/production.rb`
:
`config/environments/production.rb`
:
...
@@ -1033,6 +1034,10 @@ option, take care to paste this configuration option only into `production.rb`
...
@@ -1033,6 +1034,10 @@ option, take care to paste this configuration option only into `production.rb`
and any other environments you define with production behavior (not
and any other environments you define with production behavior (not
`application.rb`
).
`application.rb`
).
TIP: For further details have a look at the docs of your production web server:
-
[
Apache
](
https://tn123.org/mod_xsendfile/
)
-
[
Nginx
](
http://wiki.nginx.org/XSendfile
)
Assets Cache Store
Assets Cache Store
------------------
------------------
...
...
guides/source/getting_started.md
浏览文件 @
3e3ed1ed
...
@@ -1119,7 +1119,11 @@ The `method: :patch` option tells Rails that we want this form to be submitted
...
@@ -1119,7 +1119,11 @@ The `method: :patch` option tells Rails that we want this form to be submitted
via the
`PATCH`
HTTP method which is the HTTP method you're expected to use to
via the
`PATCH`
HTTP method which is the HTTP method you're expected to use to
**update**
resources according to the REST protocol.
**update**
resources according to the REST protocol.
TIP: By default forms built with the _form_for_ helper are sent via
`POST`
.
The first parameter of the
`form_tag`
can be an object, say,
`@article`
which would
cause the helper to fill in the form with the fields of the object. Passing in a
symbol (
`:article`
) with the same name as the instance variable (
`@article`
) also
automagically leads to the same behavior. This is what is happening here. More details
can be found in
[
form_for documentation
](
http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html#method-i-form_for
)
.
Next we need to create the
`update`
action in
Next we need to create the
`update`
action in
`app/controllers/articles_controller.rb`
:
`app/controllers/articles_controller.rb`
:
...
@@ -1390,7 +1394,9 @@ class CreateComments < ActiveRecord::Migration
...
@@ -1390,7 +1394,9 @@ class CreateComments < ActiveRecord::Migration
create_table
:comments
do
|
t
|
create_table
:comments
do
|
t
|
t
.
string
:commenter
t
.
string
:commenter
t
.
text
:body
t
.
text
:body
t
.
references
:article
,
index:
true
# this line adds an integer column called `article_id`.
t
.
references
:article
,
index:
true
t
.
timestamps
t
.
timestamps
end
end
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录