aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/routing/mapper.rb
diff options
context:
space:
mode:
authorPiotr Sarnacki <drogus@gmail.com>2010-07-07 11:26:03 +0200
committerPiotr Sarnacki <drogus@gmail.com>2010-09-03 22:59:05 +0200
commit451c9942bb493190d5673c1b55be7506056db13b (patch)
tree4570ad54ce7d5c9ff2cab6ab3697531ec903b7ca /actionpack/lib/action_dispatch/routing/mapper.rb
parent628b94fbc81cb02b753d0f717a875219853b5764 (diff)
downloadrails-451c9942bb493190d5673c1b55be7506056db13b.tar.gz
rails-451c9942bb493190d5673c1b55be7506056db13b.tar.bz2
rails-451c9942bb493190d5673c1b55be7506056db13b.zip
Allow to generate Application routes inside Engine
This requires knowledge about original SCRIPT_NAME and the parent router. It should be pass through the env as ORIGIAL_SCRIPT_NAME and action_dispatch.parent_routes
Diffstat (limited to 'actionpack/lib/action_dispatch/routing/mapper.rb')
-rw-r--r--actionpack/lib/action_dispatch/routing/mapper.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb
index f3aa09f4a7..0e138524cd 100644
--- a/actionpack/lib/action_dispatch/routing/mapper.rb
+++ b/actionpack/lib/action_dispatch/routing/mapper.rb
@@ -289,7 +289,7 @@ module ActionDispatch
app.routes.class_eval do
define_method :_generate_prefix do |options|
keys = _route.segment_keys + ActionDispatch::Routing::RouteSet::RESERVED_OPTIONS
- prefix_options = options.reject { |k, v| !(keys).include?(k) }
+ prefix_options = options.slice(*keys)
# we must actually delete prefix segment keys to avoid passing them to next url_for
_route.segment_keys.each { |k| options.delete(k) }
_router.url_helpers.send("#{name}_path", prefix_options)