Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

use extract_options!

  • Loading branch information...
commit e821611cb6142d2055de565fabe783ffd6ef4cfb 1 parent 5c0cbb3
@pwim authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  actionpack/lib/action_dispatch/routing/redirection.rb
View
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(SubdomainRedirector.new('api'))
#
def redirect(*args, &block)
- options = args.last.is_a?(Hash) ? args.pop : {}
+ options = args.extract_options!
status = options.delete(:status) || 301
return OptionRedirect.new(status, options) if options.any?
Please sign in to comment.
Something went wrong with that request. Please try again.