diff --git a/config/routes.rb b/config/routes.rb index ff0df27..c9932b2 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -76,6 +76,6 @@ ActionController::Routing::Routes.draw do |map| # *content viewing* # XXX this route must come last so other routes have priority over it. - map.homepage ':profile/*page', :controller => 'content_viewer', :action => 'view_page' + map.homepage ':profile/*page', :controller => 'content_viewer', :action => 'view_page', :profile => /[a-z][a-z0-9._-]*/ end diff --git a/test/integration/routing_test.rb b/test/integration/routing_test.rb index cd3cf1a..19e0091 100644 --- a/test/integration/routing_test.rb +++ b/test/integration/routing_test.rb @@ -122,4 +122,8 @@ class RoutingTest < ActionController::IntegrationTest assert_routing('/ze-withdash', :controller => 'content_viewer', :action => 'view_page', :profile => 'ze-withdash', :page => []) end + def test_content_view_with_underscore + assert_routing('/ze_with_underscore', :controller => 'content_viewer', :action => 'view_page', :profile => 'ze_with_underscore', :page => []) + end + end -- libgit2 0.21.2