diff options
author | Nicholas Seckar <nseckar@gmail.com> | 2005-09-11 13:56:43 +0000 |
---|---|---|
committer | Nicholas Seckar <nseckar@gmail.com> | 2005-09-11 13:56:43 +0000 |
commit | 27962ead0380dcc3997eb45714d6334960f8cce7 (patch) | |
tree | f0128845facd2e506f6c53ca8853042734a94d7b /actionpack/lib/action_controller/routing.rb | |
parent | 9e5d64b3bbc9a1a4b15c4728d65dbce226ca9512 (diff) | |
download | rails-27962ead0380dcc3997eb45714d6334960f8cce7.tar.gz rails-27962ead0380dcc3997eb45714d6334960f8cce7.tar.bz2 rails-27962ead0380dcc3997eb45714d6334960f8cce7.zip |
Add ability to specify Route Regexps for controllers. Closes #1917.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2205 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller/routing.rb')
-rw-r--r-- | actionpack/lib/action_controller/routing.rb | 9 |
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 |