aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/routing.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_controller/routing.rb')
-rw-r--r--actionpack/lib/action_controller/routing.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/routing.rb b/actionpack/lib/action_controller/routing.rb
index f06a464adb..c6cd8df6b4 100644
--- a/actionpack/lib/action_controller/routing.rb
+++ b/actionpack/lib/action_controller/routing.rb
@@ -192,7 +192,14 @@ module ActionController
g << "controller_result = ::ActionController::Routing::ControllerComponent.traverse_to_controller(#{g.path_name}, #{g.index_name})"
g.if('controller_result') do |gp|
gp << 'controller_value, segments_to_controller = controller_result'
- gp.move_forward('segments_to_controller') {|gpp| yield gpp, :constraint}
+ if condition
+ gp << "controller_path = #{gp.path_name}[#{gp.index_name},segments_to_controller].join('/')"
+ gp.if(Routing.test_condition("controller_path", condition)) do |gpp|
+ gpp.move_forward('segments_to_controller') {|gppp| yield gppp, :constraint}
+ end
+ else
+ gp.move_forward('segments_to_controller') {|gpp| yield gpp, :constraint}
+ end
end
end