Fix formats on xhr requests when HTTP_ACCEPT is empty string

Fix ActionDispatch::Request#formats on xhr requests when HTTP_ACCEPT
header is empty string. About issue #7774, same fix as in commit bebb02f
but for xhr requests.
Merge pull request #9541 from maximerety/fix_7774

Fix formats on xhr requests when HTTP_ACCEPT is empty string
only calculate next_id when we need a new method defined
rewrite tests to have no side-effects on `include_root_in_json`.
`ActiveRecord::Base.include_root_in_json` is `false` by default.

Closes #9459.

The PR #6597 unified the configuration for `include_root_in_json`
in AM and AR to `false`.
Later on with the refactoring commit: e030f26 the value in AR was
set to `true` but I think this was not on purpose.

With this commit both AM and AR will have the same configuration
for `include_root_in_json`, which is `false`.
Merge pull request #9467 from senny/9459_include_json_root_out_of_sync

`ActiveRecord::Base.include_root_in_json` is `false` by default.
adds guides/.document to tell rdoc not to process this directory

When the Rails 4 gem is installed rdoc sees markdown files below the
guides directory and processes them. With an empty .document file
we prevent that from happening. Thanks to @drbrain for the tip.
Call String#gsub with Hash directly
Merge pull request #9554 from tmm1/string-gsub-hash

Use 1.9 String#gsub syntax
change useless gsub to delete
strong parameters example for default values using `fetch`. [ci skip]

Origin: #9534.
example for `accepts_nested_attribtues_for` and strong parameters.

Closes #9558.
Merge pull request #9556 from senny/strong_params_examples

strong parameters example for default values using `fetch`.
Fix typo in AC overview guide [ci skip]
Merge pull request #9557 from bonsaiben/useless_gsub

Change useless gsub to delete
Routing match `via` option requirement exception message made more explicit
Merge pull request #9561 from inossidabile/explicit_match_via_requirement_exception_message

Routing match `via` option requirement exception message made more explicit
assigning '0.0' to a nullable numeric column does not make it dirty
Merge pull request #9042 from senny/9034_float_0_0_is_always_dirty

Assigning '0.0' to a nullable numeric column does not make it dirty

Example:
    product = Product.create price: 0.0
    product.price = '0.0'
    product.changed? # => false (this used to return true)
    product.changes # => {} (this used to return { price: [0.0, 0.0] })
change useless gsub to tr