rails/rails — pull request #8653 by laserlemon (2012-12-29 20:01:29+00:00)
Title: Allow the `:location` option to `respond_with` to accept a proc

This allows `respond_with` to accept a `:location` option with a value that might fail if the resource in question could not be saved. Some named route methods might raise an error if the resource isn't persisted and consequently has no ID. Passing a proc allows execution to be delayed until such time as the Location header is needed (if it's needed).