Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


use extract_options! #6139

merged 1 commit into from

3 participants


No description provided.


Please add a require to array/extract_options from active_support. Thanks!


@carlosantoniodasilva Thanks! I updated my pull request to include the require.


@pwin Great, thanks!

@josevalim josevalim merged commit fb7abea into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 3, 2012
  1. @pwim

    use extract_options!

    pwim authored
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 1 deletion.
  1. +2 −1  actionpack/lib/action_dispatch/routing/redirection.rb
3  actionpack/lib/action_dispatch/routing/redirection.rb
@@ -1,5 +1,6 @@
require 'action_dispatch/http/request'
require 'active_support/core_ext/uri'
+require 'active_support/core_ext/array/extract_options'
require 'rack/utils'
module ActionDispatch
@@ -99,7 +100,7 @@ module Redirection
# match 'accounts/:name' => redirect('api'))
def redirect(*args, &block)
- options = args.last.is_a?(Hash) ? args.pop : {}
+ options = args.extract_options!
status = options.delete(:status) || 301
return, options) if options.any?
Something went wrong with that request. Please try again.