Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Getting started guide fixes & Explain X-SendFile a little better, wit…

…h links

Explain how form_for :article is able to pull in the properties of @article
Make it clear that article_id is generated due to the association set up

Add link to the rails function that uses X-Sendfile.
Add links to apache and nginx docs for the header
  • Loading branch information...
commit 8e6d0fd4343cc68aab1e2b46363a930130fca6e5 1 parent 28abd96
@ktaragorn ktaragorn authored
7 guides/source/
@@ -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
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
+faster. Have a look at [send_file](
+on how to use this feature.
Apache and nginx support this option, which can be enabled in
@@ -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
+TIP: For further details have a look at the docs of your production web server:
+- [Apache](
+- [Nginx](
Assets Cache Store
10 guides/source/
@@ -1105,7 +1105,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
**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](
Next we need to create the `update` action in
@@ -1376,7 +1380,9 @@ class CreateComments < ActiveRecord::Migration
create_table :comments do |t|
t.string :commenter
t.text :body
- t.references :article, index: true
+ # this line adds an integer column called `article_id`.
+ t.references :article, index: true

0 comments on commit 8e6d0fd

Please sign in to comment.
Something went wrong with that request. Please try again.