From c42a7a0082a16b47b6bb6d1b919a4b5ec6e7860d Mon Sep 17 00:00:00 2001 From: kennyj Date: Wed, 6 Jun 2012 00:59:01 +0900 Subject: Support unicode character route in config/routes.rb. --- guides/source/routing.textile | 8 ++++++++ guides/source/upgrading_ruby_on_rails.textile | 2 ++ 2 files changed, 10 insertions(+) (limited to 'guides') diff --git a/guides/source/routing.textile b/guides/source/routing.textile index 7941e655bb..dae25853cd 100644 --- a/guides/source/routing.textile +++ b/guides/source/routing.textile @@ -644,6 +644,14 @@ You should put the +root+ route at the top of the file, because it is the most p NOTE: The +root+ route only routes +GET+ requests to the action. +h4. Unicode character routes + +You can specify unicode character routes directly. For example + + +match 'こんにちは' => 'welcome#index' + + h3. Customizing Resourceful Routes While the default routes and helpers generated by +resources :posts+ will usually serve you well, you may want to customize them in some way. Rails allows you to customize virtually any generic part of the resourceful helpers. diff --git a/guides/source/upgrading_ruby_on_rails.textile b/guides/source/upgrading_ruby_on_rails.textile index 6cdc6ab289..4bf4751127 100644 --- a/guides/source/upgrading_ruby_on_rails.textile +++ b/guides/source/upgrading_ruby_on_rails.textile @@ -50,6 +50,8 @@ h4(#action_pack4_0). Action Pack Rails 4.0 changed how assert_generates, assert_recognizes, and assert_routing work. Now all these assertions raise Assertion instead of ActionController::RoutingError. +Rails 4.0 also changed the way unicode character routes are drawn. Now you can draw unicode character routes directly. If you already draw such routes, you must change them, e.g. get Rack::Utils.escape('こんにちは'), :controller => 'welcome', :action => 'index' to get 'こんにちは', :controller => 'welcome', :action => 'index'. + h4(#helpers_order). Helpers Loading Order The loading order of helpers from more than one directory has changed in Rails 4.0. Previously, helpers from all directories were gathered and then sorted alphabetically. After upgrade to Rails 4.0 helpers will preserve the order of loaded directories and will be sorted alphabetically only within each directory. Unless you explicitly use helpers_path parameter, this change will only impact the way of loading helpers from engines. If you rely on the fact that particular helper from engine loads before or after another helper from application or another engine, you should check if correct methods are available after upgrade. If you would like to change order in which engines are loaded, you can use config.railties_order= method. -- cgit v1.2.3