Changeset 4998
- Timestamp:
- 09/04/06 20:09:15 (2 years ago)
- Files:
-
- trunk/actionpack/lib/action_controller/routing.rb (modified) (1 diff)
- trunk/actionpack/test/controller/routing_test.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/actionpack/lib/action_controller/routing.rb
r4763 r4998 557 557 558 558 def match_extraction(next_capture) 559 hangon = (default ? "|| #{default.inspect}" : "if match[#{next_capture}]") 560 "params[:#{key}] = match[#{next_capture}].downcase #{hangon}" 559 if default 560 "params[:#{key}] = match[#{next_capture}] ? match[#{next_capture}].downcase : '#{default}'" 561 else 562 "params[:#{key}] = match[#{next_capture}].downcase if match[#{next_capture}]" 563 end 561 564 end 562 565 end trunk/actionpack/test/controller/routing_test.rb
r4907 r4998 1287 1287 end 1288 1288 1289 def test_draw_default_route_with_default_controller 1290 ActionController::Routing.with_controllers(['users']) do 1291 set.draw do |map| 1292 map.connect '/:controller/:action/:id', :controller => 'users' 1293 end 1294 assert_equal({:controller => 'users', :action => 'index'}, set.recognize_path('/')) 1295 end 1296 end 1297 1289 1298 def test_route_with_parameter_shell 1290 1299 ActionController::Routing.with_controllers(['users', 'pages']) do