Avoid relying on error messages when rescuing

When we are rescuing from an error, it's a brittle approach to do checks
with regular expressions on the raised message because it may change in
in the future and error messages are different across implementations.

The NameError API could be improved at the MRI level but for now we need
to rely on its #name. A #== check will only pass for top level constants
or only when the last constant of the path is missing so we need to rely
on #include? instead. For instance:

    begin
      Namespace::Foo
    rescue NameError => e
      e.name # => :Namespace
    end

However, if the name-space already exists, only the name of the first
missing constant in the path is returned (e.g. for Math::PHI, the name
would be :PHI). JRuby will return a fully qualified name (:"Math::PHI").

We need to keep the == check for 1.9 compatibility since const_get will
raise a NameError with a name attribute set to the given string if it's
one of "::" or "".

See http://git.io/jnSN7g for further information.
Implement `_was` and `changes` for in-place mutations of AR attributes
Don't expose these new APIs yet (added in 877ea78 / #16189)

WARNING: don't use them! They might change or go away between future beta/RC/
patch releases!

Also added a CHANGELOG entry for this.
Merge pull request #16189 from sgrif/sg-attribute-was-in-place

Implement `_was` and `changes` for in-place mutations of AR attributes
[ci skip] Fix sample code in Layouts and Rendering guide
When your templates change, browser caches bust automatically.

New default: the template digest is automatically included in your ETags.
When you call `fresh_when @post`, the digest for `posts/show.html.erb`
is mixed in so future changes to the HTML will blow HTTP caches for you.
This makes it easy to HTTP-cache many more of your actions.

If you render a different template, you can now pass the `:template`
option to include its digest instead:

  fresh_when @post, template: 'widgets/show'

Pass `template: false` to skip the lookup. To turn this off entirely, set:

  config.action_controller.etag_with_template_digest = false
Merge pull request #16527 from jeremy/etag_with_template_digest

When your templates change, browser caches bust automatically.
Merge pull request #16338 from robin850/rbx-safe-constantize

Avoid relying on error messages when rescuing
Allow usage of bundle local config for rack by specifying the branch

[ci skip]
Merge pull request #16529 from y-yagi/patch-1

[ci skip] Fix sample code in Layouts and Rendering guide
Move respond_with to the responders gem

respond_with (and consequently the class-level respond_to)
are being removed from Rails. Instead of moving it to a 3rd
library, the functionality will be moved to responders gem
(at github.com/plataformatec/responders) which already provides
some responders extensions.
Remove usafe of respond_to in ActionView tests
Remove more references to respond_with