Можно ли установить строку Unicode как сегмент пути в Rails?
Я пробую следующее:
# app/controllers/magazines_controller.rb
class MagazinesController < ApplicationController
def index
end
end
# encoding: utf-8
# config/routes.rb
PublishingHouse::Application.routes.draw do
resources :magazines,
:only => :index,
:path => :журналы # a Unicode string is set as a segment of the path
end
$ rake routes
magazines GET /журналы(.:format) {:action=>"index", :controller=>"magazines"}
Но когда я иду по пути, я получаю ошибку маршрутизации:
$ w3m http://localhost:3000/журналы
...
Routing Error
No route matches "/%D0%B6%D1%83%D1%80%D0%BD%D0%B0%D0%BB%D1%8B"
Вот журнал сервера:
$ rails s thin
...
Started GET "/%D0%B6%D1%83%D1%80%D0%BD%D0%B0%D0%BB%D1%8B" for 127.0.0.1 at 2010-09-26 13:35:00 +0400
ActionController::RoutingError (No route matches "/%D0%B6%D1%83%D1%80%D0%BD%D0%B0%D0%BB%D1%8B"):
Rendered /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-3.0.0/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (1.2ms)
Спасибо.
Debian GNU / Linux 5.0.6;
Рубин 1.9.2;
Ruby on Rails 3.0.0.